{
    "content": [
        {
            "type": "text",
            "text": "# Config::Tiny (perldoc)\n\n## NAME\n\nConfig::Tiny - Read/Write .ini style files with as little code as possible\n\n## SYNOPSIS\n\n# In your configuration file\nrootproperty=blah\n[section]\none=twp\nthree= four\nFoo =Bar\nempty=\n# In your program\nuse Config::Tiny;\n# Create an empty config\nmy $Config = Config::Tiny->new;\n# Create a config with data\nmy $config = Config::Tiny->new({\n=> { rootproperty => \"Bar\" },\nsection => { one => \"value\", Foo => 42 } });\n# Open the config\n$Config = Config::Tiny->read( 'file.conf' );\n$Config = Config::Tiny->read( 'file.conf', 'utf8' ); # Neither ':' nor '<:' prefix!\n$Config = Config::Tiny->read( 'file.conf', 'encoding(iso-8859-1)');\n# Reading properties\nmy $rootproperty = $Config->{}->{rootproperty};\nmy $one = $Config->{section}->{one};\nmy $Foo = $Config->{section}->{Foo};\n# Changing data\n$Config->{newsection} = { this => 'that' }; # Add a section\n$Config->{section}->{Foo} = 'Not Bar!';     # Change a value\ndelete $Config->{};                        # Delete a value or section\n# Save a config\n$Config->write( 'file.conf' );\n$Config->write( 'file.conf', 'utf8' ); # Neither ':' nor '>:' prefix!\n# Shortcuts\nmy($rootproperty) = $$Config{}{rootproperty};\nmy($config) = Config::Tiny -> readstring('alpha=bet');\nmy($value)  = $$config{}{alpha}; # $value is 'bet'.\nmy($config) = Config::Tiny -> readstring(\"[init]\\nalpha=bet\");\nmy($value)  = $$config{init}{alpha}; # $value is 'bet'.\n\n## DESCRIPTION\n\n\"Config::Tiny\" is a Perl class to read and write .ini style configuration files with as little\ncode as possible, reducing load time and memory overhead.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **CONFIGURATION FILE SYNTAX**\n- **METHODS**\n- **FAQ**\n- **CAVEATS**\n- **Repository**\n- **SUPPORT**\n- **AUTHOR**\n- **ACKNOWLEGEMENTS**\n- **SEE ALSO**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Config::Tiny",
        "section": "",
        "mode": "perldoc",
        "summary": "Config::Tiny - Read/Write .ini style files with as little code as possible",
        "synopsis": "# In your configuration file\nrootproperty=blah\n[section]\none=twp\nthree= four\nFoo =Bar\nempty=\n# In your program\nuse Config::Tiny;\n# Create an empty config\nmy $Config = Config::Tiny->new;\n# Create a config with data\nmy $config = Config::Tiny->new({\n=> { rootproperty => \"Bar\" },\nsection => { one => \"value\", Foo => 42 } });\n# Open the config\n$Config = Config::Tiny->read( 'file.conf' );\n$Config = Config::Tiny->read( 'file.conf', 'utf8' ); # Neither ':' nor '<:' prefix!\n$Config = Config::Tiny->read( 'file.conf', 'encoding(iso-8859-1)');\n# Reading properties\nmy $rootproperty = $Config->{}->{rootproperty};\nmy $one = $Config->{section}->{one};\nmy $Foo = $Config->{section}->{Foo};\n# Changing data\n$Config->{newsection} = { this => 'that' }; # Add a section\n$Config->{section}->{Foo} = 'Not Bar!';     # Change a value\ndelete $Config->{};                        # Delete a value or section\n# Save a config\n$Config->write( 'file.conf' );\n$Config->write( 'file.conf', 'utf8' ); # Neither ':' nor '>:' prefix!\n# Shortcuts\nmy($rootproperty) = $$Config{}{rootproperty};\nmy($config) = Config::Tiny -> readstring('alpha=bet');\nmy($value)  = $$config{}{alpha}; # $value is 'bet'.\nmy($config) = Config::Tiny -> readstring(\"[init]\\nalpha=bet\");\nmy($value)  = $$config{init}{alpha}; # $value is 'bet'.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 48,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "CONFIGURATION FILE SYNTAX",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 56,
                "subsections": []
            },
            {
                "name": "FAQ",
                "lines": 77,
                "subsections": []
            },
            {
                "name": "CAVEATS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "Repository",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SUPPORT",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "ACKNOWLEGEMENTS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 33,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 7,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Config::Tiny - Read/Write .ini style files with as little code as possible\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "# In your configuration file\nrootproperty=blah\n\n[section]\none=twp\nthree= four\nFoo =Bar\nempty=\n\n# In your program\nuse Config::Tiny;\n\n# Create an empty config\nmy $Config = Config::Tiny->new;\n\n# Create a config with data\nmy $config = Config::Tiny->new({\n=> { rootproperty => \"Bar\" },\nsection => { one => \"value\", Foo => 42 } });\n\n# Open the config\n$Config = Config::Tiny->read( 'file.conf' );\n$Config = Config::Tiny->read( 'file.conf', 'utf8' ); # Neither ':' nor '<:' prefix!\n$Config = Config::Tiny->read( 'file.conf', 'encoding(iso-8859-1)');\n\n# Reading properties\nmy $rootproperty = $Config->{}->{rootproperty};\nmy $one = $Config->{section}->{one};\nmy $Foo = $Config->{section}->{Foo};\n\n# Changing data\n$Config->{newsection} = { this => 'that' }; # Add a section\n$Config->{section}->{Foo} = 'Not Bar!';     # Change a value\ndelete $Config->{};                        # Delete a value or section\n\n# Save a config\n$Config->write( 'file.conf' );\n$Config->write( 'file.conf', 'utf8' ); # Neither ':' nor '>:' prefix!\n\n# Shortcuts\nmy($rootproperty) = $$Config{}{rootproperty};\n\nmy($config) = Config::Tiny -> readstring('alpha=bet');\nmy($value)  = $$config{}{alpha}; # $value is 'bet'.\n\nmy($config) = Config::Tiny -> readstring(\"[init]\\nalpha=bet\");\nmy($value)  = $$config{init}{alpha}; # $value is 'bet'.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "\"Config::Tiny\" is a Perl class to read and write .ini style configuration files with as little\ncode as possible, reducing load time and memory overhead.\n\nMost of the time it is accepted that Perl applications use a lot of memory and modules.\n\nThe *::Tiny family of modules is specifically intended to provide an ultralight alternative to\nthe standard modules.\n\nThis module is primarily for reading human written files, and anything we write shouldn't need\nto have documentation/comments. If you need something with more power move up to Config::Simple,\nConfig::General or one of the many other \"Config::*\" modules.\n\nLastly, Config::Tiny does not preserve your comments, whitespace, or the order of your config\nfile.\n\nSee Config::Tiny::Ordered (and possibly others) for the preservation of the order of the entries\nin the file.\n",
                "subsections": []
            },
            "CONFIGURATION FILE SYNTAX": {
                "content": "Files are the same format as for MS Windows \"*.ini\" files. For example:\n\n[section]\nvar1=value1\nvar2=value2\n\nIf a property is outside of a section at the beginning of a file, it will be assigned to the\n\"root section\", available at \"$Config->{}\".\n\nLines starting with '#' or ';' are considered comments and ignored, as are blank lines.\n\nWhen writing back to the config file, all comments, custom whitespace, and the ordering of your\nconfig file elements are discarded. If you need to keep the human elements of a config when\nwriting back, upgrade to something better, this module is not for you.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "errstr()\nReturns a string representing the most recent error, or the empty string.\n\nYou can also retrieve the error message from the $Config::Tiny::errstr variable.\n\nnew([$config])\nHere, the [] indicate an optional parameter.\n\nThe constructor \"new\" creates and returns a \"Config::Tiny\" object.\n\nThis will normally be a new, empty configuration, but you may also pass a hashref here which\nwill be turned into an object of this class. This hashref should have a structure suitable for a\nconfiguration file, that is, a hash of hashes where the key \"\" is treated specially as the root\nsection.\n\nread($filename, [$encoding])\nHere, the [] indicate an optional parameter.\n\nThe \"read\" constructor reads a config file, $filename, and returns a new \"Config::Tiny\" object\ncontaining the properties in the file.\n\n$encoding may be used to indicate the encoding of the file, e.g. 'utf8' or\n'encoding(iso-8859-1)'.\n\nDo not add a prefix to $encoding, such as '<' or '<:'.\n\nReturns the object on success, or \"undef\" on error.\n\nWhen \"read\" fails, \"Config::Tiny\" sets an error message internally you can recover via\n\"Config::Tiny->errstr\". Although in some cases a failed \"read\" will also set the operating\nsystem error variable $!, not all errors do and you should not rely on using the $! variable.\n\nSee t/04.utf8.t and t/04.utf8.txt.\n\nreadstring($string)\nThe \"readstring\" method takes as argument the contents of a config file as a string and returns\nthe \"Config::Tiny\" object for it.\n\nwrite($filename, [$encoding])\nHere, the [] indicate an optional parameter.\n\nThe \"write\" method generates the file content for the properties, and writes it to disk to the\nfilename specified.\n\n$encoding may be used to indicate the encoding of the file, e.g. 'utf8' or\n'encoding(iso-8859-1)'.\n\nDo not add a prefix to $encoding, such as '>' or '>:'.\n\nReturns true on success or \"undef\" on error.\n\nSee t/04.utf8.t and t/04.utf8.txt.\n\nwritestring()\nGenerates the file content for the object and returns it as a string.\n",
                "subsections": []
            },
            "FAQ": {
                "content": "What happens if a key is repeated?\nThe last value is retained, overwriting any previous values.\n\nSee t/06.repeat.key.t.\n\nWhy can't I put comments at the ends of lines?\no The # char is only introduces a comment when it's at the start of a line.\nSo a line like:\n\nkey=value # A comment\n\nSets key to 'value # A comment', which, presumably, you did not intend.\n\nThis conforms to the syntax discussed in \"CONFIGURATION FILE SYNTAX\".\n\no Comments matching /\\s\\;\\s.+$//g; are ignored.\nThis means you can't preserve the suffix using:\n\nkey = Prefix ; Suffix\n\nResult: key is now 'Prefix'.\n\nBut you can do this:\n\nkey = Prefix;Suffix\n\nResult: key is now 'Prefix;Suffix'.\n\nOr this:\n\nkey = Prefix; Suffix\n\nResult: key is now 'Prefix; Suffix'.\n\nSee t/07.trailing.comment.t.\n\nWhy can't I omit the '=' signs?\nE.g.:\n\n[Things]\nmy =\nlist =\nof =\nthings =\n\nInstead of:\n\n[Things]\nmy\nlist\nof\nthings\n\nBecause the use of '=' signs is a type of mandatory documentation. It indicates that that\nsection contains 4 items, and not 1 odd item split over 4 lines.\n\nWhy do I have to assign the result of a method call to a variable?\nThis question comes from RT#85386.\n\nYes, the syntax may seem odd, but you don't have to call both new() and readstring().\n\nTry:\n\nperl -MData::Dumper -MConfig::Tiny -E 'my $c=Config::Tiny->readstring(\"one=s\"); say Dumper $c'\n\nOr:\n\nmy($config) = Config::Tiny -> readstring('alpha=bet');\nmy($value)  = $$config{}{alpha}; # $value is 'bet'.\n\nOr even, a bit ridiculously:\n\nmy($value) = ${Config::Tiny -> readstring('alpha=bet')}{}{alpha}; # $value is 'bet'.\n\nCan I use a file called '0' (zero)?\nYes. See t/05.zero.t (test code) and t/0 (test data).\n",
                "subsections": []
            },
            "CAVEATS": {
                "content": "Some edge cases in section headers are not supported, and additionally may not be detected when\nwriting the config file.\n\nSpecifically, section headers with leading whitespace, trailing whitespace, or newlines anywhere\nin the section header, will not be written correctly to the file and may cause file corruption.\n",
                "subsections": []
            },
            "Repository": {
                "content": "<https://github.com/ronsavage/Config-Tiny.git>\n",
                "subsections": []
            },
            "SUPPORT": {
                "content": "Bugs should be reported via the CPAN bug tracker at\n\n<https://github.com/ronsavage/Config-Tiny/issues>\n\nFor other issues, or commercial enhancement or support, contact the author.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Adam Kennedy <adamk@cpan.org>\n\nMaintanence from V 2.15: Ron Savage <http://savage.net.au/>.\n",
                "subsections": []
            },
            "ACKNOWLEGEMENTS": {
                "content": "Thanks to Sherzod Ruzmetov <sherzodr@cpan.org> for Config::Simple, which inspired this module by\nbeing not quite \"simple\" enough for me :).\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "See, amongst many: Config::Simple and Config::General.\n\nSee Config::Tiny::Ordered (and possibly others) for the preservation of the order of the entries\nin the file.\n\nIOD. Ini On Drugs.\n\nIOD::Examples\n\nApp::IODUtils\n\nConfig::IOD::Reader\n\nConfig::Perl::V. Config data from Perl itself.\n\nConfig::Onion\n\nConfig::IniFiles\n\nConfig::INIPlus\n\nConfig::Hash. Allows nested data.\n\nConfig::MVP. Author: RJBS. Uses Moose. Extremely complex.\n\nConfig::TOML. See next few lines:\n\n<https://github.com/dlc/toml>\n\n<https://github.com/alexkalderimis/config-toml.pl>. 1 Star rating.\n\n<https://github.com/toml-lang/toml>\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright 2002 - 2011 Adam Kennedy.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n\nThe full text of the license can be found in the LICENSE file included with this module.\n",
                "subsections": []
            }
        }
    }
}