{
    "content": [
        {
            "type": "text",
            "text": "# URI::QueryParam (perldoc)\n\n**Summary:** URI::QueryParam - Additional query methods for URIs\n\n**Synopsis:** use URI;\nuse URI::QueryParam;\n$u = URI->new(\"\", \"http\");\n$u->queryparam(foo => 1, 2, 3);\nprint $u->query;    # prints foo=1&foo=2&foo=3\nfor my $key ($u->queryparam) {\nprint \"$key: \", join(\", \", $u->queryparam($key)), \"\\n\";\n}\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (11 lines)\n- **DESCRIPTION** (73 lines)\n- **SEE ALSO** (2 lines)\n- **COPYRIGHT** (2 lines)\n\n## Full Content\n\n### NAME\n\nURI::QueryParam - Additional query methods for URIs\n\n### SYNOPSIS\n\nuse URI;\nuse URI::QueryParam;\n\n$u = URI->new(\"\", \"http\");\n$u->queryparam(foo => 1, 2, 3);\nprint $u->query;    # prints foo=1&foo=2&foo=3\n\nfor my $key ($u->queryparam) {\nprint \"$key: \", join(\", \", $u->queryparam($key)), \"\\n\";\n}\n\n### DESCRIPTION\n\nLoading the \"URI::QueryParam\" module adds some extra methods to URIs\nthat support query methods. These methods provide an alternative\ninterface to the $u->queryform data.\n\nThe queryparam* methods have deliberately been made identical to the\ninterface of the corresponding \"CGI.pm\" methods.\n\nThe following additional methods are made available:\n\n@keys = $u->queryparam\n@values = $u->queryparam( $key )\n$firstvalue = $u->queryparam( $key )\n$u->queryparam( $key, $value,... )\nIf $u->queryparam is called with no arguments, it returns all the\ndistinct parameter keys of the URI. In a scalar context it returns\nthe number of distinct keys.\n\nWhen a $key argument is given, the method returns the parameter\nvalues with the given key. In a scalar context, only the first\nparameter value is returned.\n\nIf additional arguments are given, they are used to update\nsuccessive parameters with the given key. If any of the values\nprovided are array references, then the array is dereferenced to get\nthe actual values.\n\nPlease note that you can supply multiple values to this method, but\nyou cannot supply multiple keys.\n\nDo this:\n\n$uri->queryparam( widgetid => 1, 5, 9 );\n\nDo NOT do this:\n\n$uri->queryparam( widgetid => 1, frobnicatorid => 99 );\n\n$u->queryparamappend($key, $value,...)\nAdds new parameters with the given key without touching any old\nparameters with the same key. It can be explained as a more\nefficient version of:\n\n$u->queryparam($key,\n$u->queryparam($key),\n$value,...);\n\nOne difference is that this expression would return the old values\nof $key, whereas the queryparamappend() method does not.\n\n@values = $u->queryparamdelete($key)\n$firstvalue = $u->queryparamdelete($key)\nDeletes all key/value pairs with the given key. The old values are\nreturned. In a scalar context, only the first value is returned.\n\nUsing the queryparamdelete() method is slightly more efficient\nthan the equivalent:\n\n$u->queryparam($key, []);\n\n$hashref = $u->queryformhash\n$u->queryformhash( \\%newform )\nReturns a reference to a hash that represents the query form's\nkey/value pairs. If a key occurs multiple times, then the hash value\nbecomes an array reference.\n\nNote that sequence information is lost. This means that:\n\n$u->queryformhash($u->queryformhash);\n\nis not necessarily a no-op, as it may reorder the key/value pairs.\nThe values returned by the queryparam() method should stay the same\nthough.\n\n### SEE ALSO\n\nURI, CGI\n\n### COPYRIGHT\n\nCopyright 2002 Gisle Aas.\n\n"
        }
    ],
    "structuredContent": {
        "command": "URI::QueryParam",
        "section": "",
        "mode": "perldoc",
        "summary": "URI::QueryParam - Additional query methods for URIs",
        "synopsis": "use URI;\nuse URI::QueryParam;\n$u = URI->new(\"\", \"http\");\n$u->queryparam(foo => 1, 2, 3);\nprint $u->query;    # prints foo=1&foo=2&foo=3\nfor my $key ($u->queryparam) {\nprint \"$key: \", join(\", \", $u->queryparam($key)), \"\\n\";\n}",
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 73,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 2,
                "subsections": []
            }
        ]
    }
}