The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Config::Nested::Section - contain the configuration from a section statement in a Config::Nested configuration file.

SYNOPSIS

  use Config::Nested;
  use Data::Dumper;

  my $obj = new Config::Nested::Section(
        list    => [],
        owner   => '',
        location=> '',
        colour  => {},
        contents=> {},
  );

  $obj->owner('Fred');
  $obj->location('here');
  $obj->list(qw(a b c d e));

  my $clone = $obj->new();

  print Dumper($obj);

This produces the output:

  $VAR1 = bless( {
                 'colour'       => {},
                 'contents'     => {},
                 'list'         => [ 'a', 'b', 'c', 'd', 'e' ],
                 'location'     => 'here',
                 'owner'        => 'Fred'
               }, 'Config::Nested::Section' );

DESCRIPTION

Config::Nested::Section is a hash array containing the configuration for a individual section parsed from a Config::Nested configuration file.

EXPORTS

Nothing.

FUNCTIONS

$section = Config::Nested::Section->new( options )

$section->configure( options )

Construct a new Config::Nested::Section object; options can be listed as key => value pairs. The keys are

  • scalar => <array of variable>

  • array => <array of variable>

  • hash => <array of variable>

If this constructor is applied to an existing Config::Nested::Section object, then the object is cloned, augmented with the extra options and returned.

$section->member(..)

Either lookup or set the member variable corresponding to the keys of the hash array underlying the Config::Nested::Section object. If the particular member key is not present in the underlying hash, an error occurs.

If the function is given arguments, then the value is set in the object, before returning the new value. This allows the following:

        my $b = new Config::Nested::Section(array => 'path');
        $b->path->[0] ='first step';

The only member function that does not work this way is 'new', which is the constructor function and returns a cloned copy.

SEE ALSO

Config::Nested

COPYRIGHT

Copyright (c) 1998-2008 Anthony Fletcher. All rights reserved. These modules are free software; you can redistribute them and/or modify them under the same terms as Perl itself.

This code is supplied as-is - use at your own risk.

AUTHOR

Anthony Fletcher