Config-IOD-Reader
view release on metacpan or search on metacpan
a=[1,2]
NOTE: Turning this setting off violates IOD specification.
ignore_unknown_directive => bool (default: 0)
If set to true, will not die if an unknown directive is encountered. It
will simply be ignored as a regular comment.
NOTE: Turning this setting on violates IOD specification.
warn_perl => bool (default: 0)
Emit warning if configuration contains key line like these:
foo=>"bar"
foo => 123,
which suggest user is assuming configuration is in Perl format instead
of INI.
If you enable this option, but happens to have a value that begins with
">", to avoid this warning you can quote the value first:
foo=">the value does begins with a greater-than sign"
bar=">the value does begins with a greater-than sign and ends with a comma,"
METHODS
new(%attrs) => obj
$reader->read_file($filename[ , $callback ]) => hash
Read IOD configuration from a file. Die on errors.
See "read_string" for more information on $callback argument.
$reader->read_string($str[ , $callback ]) => hash
Read IOD configuration from a string. Die on errors.
$callback is an optional coderef argument that will be called during
various stages. It can be useful if you want more information
(especially ordering). It will be called with hash argument %args
* Found a directive line
Arguments passed: "event" (str, has the value of 'directive'),
"linum" (int, line number, starts from 1), "line" (str, raw line),
"directive" (str, directive name), "cur_section" (str, current
section name), "args" (array, directive arguments).
* Found a comment line
Arguments passed: "event" (str, 'comment'), "linum", "line",
"cur_section".
* Found a section line
Arguments passed: "event" (str, 'section'), "linum", "line",
"cur_section", "section" (str, section name).
* Found a key line
Arguments passed: "event" (str, 'section'), "linum", "line",
"cur_section", "key" (str, key name), "val" (any, value name,
already decoded if encoded), "raw_val" (str, raw value).
TODO: callback when there is merging.
HOMEPAGE
Please visit the project's homepage at
<https://metacpan.org/release/Config-IOD-Reader>.
SOURCE
Source repository is at
<https://github.com/perlancar/perl-Config-IOD-Reader>.
SEE ALSO
IOD - specification
Config::IOD - round-trip parser for reading as well as writing IOD
documents
IOD::Examples - sample documents
AUTHOR
perlancar <perlancar@cpan.org>
CONTRIBUTOR
Steven Haryanto <stevenharyanto@gmail.com>
CONTRIBUTING
To contribute, you can send patches by email/via RT, or send pull
requests on GitHub.
Most of the time, you don't need to build the distribution yourself. You
can simply modify the code, then test via:
% prove -l
If you want to build the distribution (e.g. to try to install it locally
on your system), you can install Dist::Zilla,
Dist::Zilla::PluginBundle::Author::PERLANCAR, and sometimes one or two
other Dist::Zilla plugin and/or Pod::Weaver::Plugin. Any additional
steps required beyond that are considered a bug and can be reported to
me.
COPYRIGHT AND LICENSE
This software is copyright (c) 2022, 2021, 2019, 2018, 2017, 2016, 2015,
2014 by perlancar <perlancar@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
BUGS
Please report any bugs or feature requests on the bugtracker website
<https://rt.cpan.org/Public/Dist/Display.html?Name=Config-IOD-Reader>
When submitting a bug or request, please include a test-file or a patch
to an existing test-file that illustrates the bug or desired feature.
( run in 1.190 second using v1.01-cache-2.11-cpan-39bf76dae61 )