Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

config::ini(3pm) [debian man page]

Config::INI(3pm)					User Contributed Perl Documentation					  Config::INI(3pm)

NAME
Config::INI - simple .ini-file format VERSION
version 0.019 SYNOPSIS
Config-INI comes with code for reading .ini files: my $config_hash = Config::INI::Reader->read_file('config.ini'); ...and for writing ".ini" files: Config::INI::Writer->write_file({ somekey => 'somevalue' }, 'config.ini'); See Config::INI::Writer and Config::INI::Reader for more examples. GRAMMAR
This section describes the format parsed and produced by Config::INI::Reader and ::Writer. It is not an exhaustive and rigorously tested formal grammar, it's just a description of this particular implementation of the not-quite-standardized "INI" format. ini-file = { <section> | <empty-line> } empty-line = [ <space> ] <line-ending> section = <section-header> { <value-assignment> | <empty-line> } section-header = [ <space> ] "[" <section-name> "]" [ <space> ] <line-ending> section-name = string value-assignment = [ <space> ] <property-name> [ <space> ] "=" [ <space> ] <value> [ <space> ] <line-ending> property-name = string-without-equals value = string comment = <space> ";" [ <string> ] line-ending = [ <comment> ] <EOL> space = ( <TAB> | " " ) * string-without-equals = string - "=" string = ? 1+ characters; not ";" or EOL; begins and ends with non-space ? Of special note is the fact that no escaping mechanism is defined, meaning that there is no way to include an EOL or semicolon (for example) in a value, property name, or section name. If you need this, either subclass, wait for a subclass to be written for you, or find one of the many other INI-style parsers on the CPAN. The order of sections and value assignments within a section are not significant, except that given multiple assignments to one property name within a section, only the final one is used. A section name may be used more than once; this will have the identical meaning as having all property assignments in all sections of that name in sequence. DON'T FORGET The definitions above refer to the format used by the Reader and Writer classes bundled in the Config-INI distribution. These classes are designed for easy subclassing, so it should be easy to replace their behavior with whatever behavior your want. Patches, feature requets, and bug reports are welcome -- but I'm more interested in making sure you can write a subclass that does what you need, and less in making Config-INI do what you want directly. THANKS
Thanks to Florian Ragwitz for improving the subclassability of Config-INI's modules, and for helping me do some of my first merging with git(7). ORIGIN
Originaly derived from Config::Tiny, by Adam Kennedy. AUTHOR
Ricardo Signes <rjbs@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2007 by Ricardo Signes. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2011-12-15 Config::INI(3pm)

Check Out this Related Man Page

Config::MVP::Reader(3pm)				User Contributed Perl Documentation				  Config::MVP::Reader(3pm)

NAME
Config::MVP::Reader - object to read config from storage into an assembler VERSION
version 2.200002 SYNOPSIS
use Config::MVP::Reader::YAML; # this doesn't really exist my $reader = Config::MVP::Reader::YAML->new; my $sequence = $reader->read_config('/etc/foobar.yml'); DESCRIPTION
A Config::MVP::Reader exists to read configuration data from storage (like a file) and convert that data into instructions to a Config::MVP::Assembler, which will in turn convert them into a Config::MVP::Sequence, the final product. METHODS
read_config my $sequence = $reader->read_config($location, \%arg); This method is passed a location, which has no set meaning, but should be the mechanism by which the Reader is told how to locate configuration. It might be a file name, a hashref of parameters, a DBH, or anything else, depending on the needs of the specific Reader subclass. It is also passed a hashref of arguments, of which there is only one valid argument: assembler - the Assembler object into which to read the config If no assembler argument is passed, one will be constructed by calling the Reader's "build_assembler" method. Subclasses should generally not override "read_config", but should instead implement a "read_into_assembler" method, described below. read_into_assembler This method should not be called directly. It is called by "read_config" with the following parameters: my $sequence = $reader->read_into_assembler( $location, $assembler ); The method should read the configuration found at $location and use it to instruct the $assembler (a Config::MVP::Assembler) what configuration to perform. The default implementation of this method will throw an exception complaining that it should have been implemented by a subclass. build_assembler If no Assembler is provided to "read_config"'s "assembler" parameter, this method will be called on the Reader to construct one. It must return a Config::MVP::Assembler object, and by default will return an entirely generic one. AUTHOR
Ricardo Signes <rjbs@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Ricardo Signes. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-03-16 Config::MVP::Reader(3pm)
Man Page