Config::Maker::Option - One configuration element.
use Config::Maker # Only constructed from the config parser $option->type $option->id "$option" $option->get($path) $option->get1($path) $option->getval($path, $default)
Config::Maker::Option objects represent individual elements of the configuration.
Config::Maker::Option
Each Config::Maker::Option object has three attributes. The -type, which is a Config::Maker::Type object, the -value, which is a string and the -children which is a list of Config::Maker::Option objects.
-type
Config::Maker::Type
-value
-children
The type can be accessed via the type method (read-only), and the value may be accessed by simple stringification. The id method is useful for reporting option in errors.
type
value
id
In addition to basic access, there are several convenience methods for doing path lookups. They are esentialy reversed Config::Maker::Path::find method, but they can construct the path from a string.
Config::Maker::Path::find
This is the simplest one. It is just calls Config::Maker::Path::find with invocant as a starting element, constructing the path with Config::Maker::Path::make if it get's a string. See Config::Maker::Path.
Config::Maker::Path::make
Unlike find, which returns an arrayref, this returns a list in list context and first match in scalar context.
find
This is like get above, but it signal an error unless the path matches exactly one element.
get
This method takes an extra argument, a default. If the path does not match, it returns the default. If it matches once, it returns the match. If it matches more than once, it signals an error.
Jan Hudec <bulb@ucw.cz>
Copyright 2004 Jan Hudec. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
configit(1), perl(1), Config::Maker(3pm).
To install Config::Maker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Config::Maker
CPAN shell
perl -MCPAN -e shell install Config::Maker
For more information on module installation, please visit the detailed CPAN module installation guide.