{
    "content": [
        {
            "type": "text",
            "text": "# Tie::CPHash (perldoc)\n\n## NAME\n\nTie::CPHash - Case preserving but case insensitive hash table\n\n## SYNOPSIS\n\nuse Tie::CPHash 2; # allows initialization during tie\ntie %cphash, 'Tie::CPHash', key => 'value';\n$cphash{'Hello World'} = 'Hi there!';\nprintf(\"The key `%s' was used to store `%s'.\\n\",\ntied(%cphash)->key('HELLO WORLD'),\n$cphash{'HELLO world'});\n\n## DESCRIPTION\n\nThe Tie::CPHash module provides a hash table that is case preserving but case insensitive. This\nmeans that\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS**\n- **DIAGNOSTICS**\n- **CONFIGURATION AND ENVIRONMENT**\n- **INCOMPATIBILITIES**\n- **BUGS AND LIMITATIONS**\n- **AUTHOR**\n- **COPYRIGHT AND LICENSE**\n- **DISCLAIMER OF WARRANTY**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Tie::CPHash",
        "section": "",
        "mode": "perldoc",
        "summary": "Tie::CPHash - Case preserving but case insensitive hash table",
        "synopsis": "use Tie::CPHash 2; # allows initialization during tie\ntie %cphash, 'Tie::CPHash', key => 'value';\n$cphash{'Hello World'} = 'Hi there!';\nprintf(\"The key `%s' was used to store `%s'.\\n\",\ntied(%cphash)->key('HELLO WORLD'),\n$cphash{'HELLO world'});",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 35,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 28,
                "subsections": []
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "CONFIGURATION AND ENVIRONMENT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "INCOMPATIBILITIES",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS AND LIMITATIONS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "DISCLAIMER OF WARRANTY",
                "lines": 16,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Tie::CPHash - Case preserving but case insensitive hash table\n",
                "subsections": []
            },
            "VERSION": {
                "content": "This document describes version 2.000 of Tie::CPHash, released January 17, 2015.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Tie::CPHash 2; # allows initialization during tie\ntie %cphash, 'Tie::CPHash', key => 'value';\n\n$cphash{'Hello World'} = 'Hi there!';\nprintf(\"The key `%s' was used to store `%s'.\\n\",\ntied(%cphash)->key('HELLO WORLD'),\n$cphash{'HELLO world'});\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The Tie::CPHash module provides a hash table that is case preserving but case insensitive. This\nmeans that\n\n$cphash{KEY}    $cphash{key}\n$cphash{Key}    $cphash{keY}\n\nall refer to the same entry. Also, the hash remembers which form of the key was last used to\nstore the entry. The \"keys\" and \"each\" functions will return the key that was used to set the\nvalue.\n\nAn example should make this clear:\n\ntie %h, 'Tie::CPHash', Hello => 'World';\nprint $h{HELLO};            # Prints 'World'\nprint keys(%h);             # Prints 'Hello'\n$h{HELLO} = 'WORLD';\nprint $h{hello};            # Prints 'WORLD'\nprint keys(%h);             # Prints 'HELLO'\n\nTie::CPHash version 2.000 introduced the ability to pass a list of \"key => value\" pairs to\ninitialize the hash (along with the \"add\" method that powers it). The list must include a value\nfor each key, or the constructor will croak.\n\nThe additional \"key\" method lets you fetch the case of a specific key:\n\n# When run after the previous example, this prints 'HELLO':\nprint tied(%h)->key('Hello');\n\n(The \"tied\" function returns the object that %h is tied to.)\n\nIf you need a case insensitive hash, but don't need to preserve case, just use $hash{lc $key}\ninstead of $hash{$key}. This has a lot less overhead than Tie::CPHash.\n\n\"use Tie::CPHash;\" does not export anything into your namespace.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "add\ntied(%h)->add( key => value, ... );\ntied(%h)->add( \\@listofkeyvaluepairs );\n\nThis method (introduced in version 2.000) adds keys and values to the hash. It's just like\n\n%h = @listofkeyvaluepairs;\n\nexcept that it doesn't clear the hash first. It accepts either a list or an arrayref. It croaks\nif the list has an odd number of entries. It returns the tied hash object.\n\nIf the list contains duplicate keys, the last \"key => value\" pair in the list wins. (You can't\npass a hashref to \"add\" because it would be ambiguous which key would win if two keys differed\nonly in case.)\n\nFor people used to Tie::IxHash, \"add\" is aliased to both \"Push\" and \"Unshift\". (Tie::CPHash does\nnot preserve the order of keys.)\n\nkey\n$setusingkey = tied(%h)->key( $key )\n\nThis method lets you fetch the case of a specific key. For example:\n\n$h{HELLO} = 'World';\nprint tied(%h)->key('Hello'); # prints HELLO\n\nIf the key does not exist in the hash, it returns \"undef\".\n",
                "subsections": []
            },
            "DIAGNOSTICS": {
                "content": "Odd number of elements in CPHash add\nYou passed a list with an odd number of elements to the \"add\" method (or to \"tie\", which\nuses \"add\"). The list must contain a value for each key.\n",
                "subsections": []
            },
            "CONFIGURATION AND ENVIRONMENT": {
                "content": "Tie::CPHash requires no configuration files or environment variables.\n",
                "subsections": []
            },
            "INCOMPATIBILITIES": {
                "content": "None reported.\n",
                "subsections": []
            },
            "BUGS AND LIMITATIONS": {
                "content": "No bugs have been reported.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Christopher J. Madsen \"<perl AT cjmweb.net>\"\n\nPlease report any bugs or feature requests to \"<bug-Tie-CPHash AT rt.cpan.org>\" or through the\nweb interface at <http://rt.cpan.org/Public/Bug/Report.html?Queue=Tie-CPHash>.\n\nYou can follow or contribute to Tie-CPHash's development at\n<https://github.com/madsen/tie-cphash>.\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is copyright (c) 2015 by Christopher J. Madsen.\n\nThis is free software; you can redistribute it and/or modify it under the same terms as the Perl\n5 programming language system itself.\n",
                "subsections": []
            },
            "DISCLAIMER OF WARRANTY": {
                "content": "BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE\nEXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER\nEXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\nSOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY\nSERVICING, REPAIR, OR CORRECTION.\n\nIN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER,\nOR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE\nLICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT\nLIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR\nOTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n",
                "subsections": []
            }
        }
    }
}