Unix::Conf::Bind8::Conf::Include - Class for representing an 'include'


Unix-Conf-Bind8 documentation  | view source Contained in the Unix-Conf-Bind8 distribution.

Index


NAME

Top

Unix::Conf::Bind8::Conf::Include - Class for representing an 'include' statement in a Bind8 configuration file.

DESCRIPTION

Top

Objects of this class contain a Unix::Conf::Bind8::Conf object

SYNOPSIS

Top

	use Unix::Conf::Bind8;

	my ($conf, $include, $conf1, $ret);

	$conf = Unix::Conf::Bind8->new_conf (
		FILE        => '/etc/named.conf',
		SECURE_OPEN => 1,
	) or $conf->die ("couldn't open `named.conf'");

	# 
	# Ways to get an include object
	#

	$include = $conf->new_include (
		FILE			=> 'slaves.conf',
		SECURE_OPEN		=> 0,
	) or $include->die ("couldn't create include object");

	# OR

	$include = $conf->get_include ('masters.conf')
		or $include->die ("couldn't get include object");

	#
	# Operations that can be performed on an Include object
	#

	# get embedded conf object.
	$conf1 = $include->get_conf () 	
		or $conf1->die ("couldn't get conf");

	# set embedded conf object
	$conf1 = Unix::Conf::Bind8->new_conf (
		FILE		=> '/etc/masters.conf',
		SECURE_OPEN	=> 0,
	) $conf1->die ("couldn't create `masters.conf'");

	$ret = $include->conf ($conf1)
		or $ret->die ("couldn't set conf");

	# delete include
	$ret = $include->delete ()
		or $ret->die ("couldn't delete");

	# OR

	$ret = $conf->delete_include ('slaves.conf')
		or $ret->die ("couldn't delete");

METHODS

Top

new ()
 Arguments
 FILE         => 'path of the configuration file',
 SECURE_OPEN  => 0/1,   # default 1 (enabled)
 WHERE  => 'FIRST'|'LAST'|'BEFORE'|'AFTER'
 WARG   => Unix::Conf::Bind8::Conf::Directive subclass object
                        # WARG is to be provided only in case WHERE eq 'BEFORE 
                        # or WHERE eq 'AFTER'
 PARENT	=> reference,   # to the Conf object datastructure.

Class constructor. Creates a Unix::Conf::Bind8::Conf::Include object, with an embedded Unix::Conf::Bind8::Conf object, and returns it, on success, an Err object otherwise. Do not use this constructor directly. Use the Unix::Conf::Bind8::Conf::new_include () method instead.

name ()

Returns the name of the include file.

conf ()
 Arguments
 Unix::Conf::Bind8::Conf object,     # optional

Get/Set the embedded Unix::Conf::Bind8::Conf. If an argument is passed, the method tries to set the embedded object to the argument, and returns true if successful, an Err object otherwise. If the argument is not passed, returns the contained Unix::Conf::Bind8::Conf object.


Unix-Conf-Bind8 documentation  | view source Contained in the Unix-Conf-Bind8 distribution.