.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.48) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Config::INI 3" .TH Config::INI 3 2026-08-26 "perl v5.44.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH SYNOPSIS .IX Header "SYNOPSIS" Config\-INI comes with code for reading \fI.ini\fR files: .PP .Vb 1 \& my $config_hash = Config::INI::Reader\->read_file(\*(Aqconfig.ini\*(Aq); .Ve .PP \&...and for writing \f(CW\*(C`.ini\*(C'\fR files: .PP .Vb 1 \& Config::INI::Writer\->write_file({ somekey => \*(Aqsomevalue\*(Aq }, \*(Aqconfig.ini\*(Aq); .Ve .PP See Config::INI::Writer and Config::INI::Reader for more examples. .SH GRAMMAR .IX Header "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\*(Aqs just a description of this particular implementation of the not\-quite\-standardized "INI" format. .PP .Vb 1 \& ini\-file = {
| } \& \& empty\-line = [ ] \& \& section = { | } \& \& section\-header = [ ] "[" "]" [ ] \& section\-name = string \& \& value\-assignment = [ ] [ ] \& "=" \& [ ] [ ] \& \& property\-name = string\-without\-equals \& value = string \& \& comment = ";" [ ] \& line\-ending = [ ] \& \& space = ( | " " ) * \& string\-without\-equals = string \- "=" \& string = ? 1+ characters; not ";" or EOL; begins and ends with non\-space ? .Ve .PP Of special note is the fact that \fIno\fR 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. .PP 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. .SH "DON\*(AqT FORGET" .IX Header "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. .PP Patches, feature requests, and bug reports are welcome \-\- but I\*(Aqm 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. .SH THANKS .IX Header "THANKS" Thanks to Florian Ragwitz for improving the subclassability of Config\-INI\*(Aqs modules, and for helping me do some of my first merging with \fBgit\fR\|(7). .SH ORIGIN .IX Header "ORIGIN" Originaly derived from Config::Tiny, by Adam Kennedy.