{
    "mode": "perldoc",
    "parameter": "CGI::Simple::Standard",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3ASimple%3A%3AStandard/json",
    "generated": "2026-06-12T21:10:49Z",
    "synopsis": "use CGI::Simple::Standard qw( -autoload );\nuse CGI::Simple::Standard qw( :core :cookie :header :misc );\nuse CGI::Simple::Standard qw( param upload );\n$CGI::Simple::Standard::POSTMAX = 1024;       # max upload via post 1kB\n$CGI::Simple::Standard::DISABLEUPLOADS = 0;   # enable uploads\n@params = param();        # return all param names as a list\n$value =  param('foo');   # return the first value supplied for 'foo'\n@values = param('foo');   # return all values supplied for foo\n%fields   = Vars();       # returns untied key value pair hash\n$hashref = Vars();       # or as a hash ref\n%fields   = Vars(\"|\");    # packs multiple values with \"|\" rather than \"\\0\";\n@keywords = keywords();   # return all keywords as a list\nparam( 'foo', 'some', 'new', 'values' );        # set new 'foo' values\nparam( -name=>'foo', -value=>'bar' );\nparam( -name=>'foo', -value=>['bar','baz'] );\nappend( -name=>'foo', -value=>'bar' );          # append values to 'foo'\nappend( -name=>'foo', -value=>['some', 'new', 'values'] );\nDelete('foo');   # delete param 'foo' and all its values\nDeleteall();    # delete everything\n<INPUT TYPE=\"file\" NAME=\"uploadfile\" SIZE=\"42\">\n$files    = upload()                   # number of files uploaded\n@files    = upload();                  # names of all uploaded files\n$filename = param('uploadfile')       # filename of 'uploadfile' field\n$mime     = uploadinfo($filename,'mime'); # MIME type of uploaded file\n$size     = uploadinfo($filename,'size'); # size of uploaded file\nmy $fh = $q->upload($filename);     # open filehandle to read from\nwhile ( read( $fh, $buffer, 1024 ) ) { ... }\n# short and sweet upload\n$ok = upload( param('uploadfile'), '/path/to/write/file.name' );\nprint \"Uploaded \".param('uploadfile').\" and wrote it OK!\" if $ok;\n$decoded    = urldecode($encoded);\n$encoded    = urlencode($unencoded);\n$escaped    = escapeHTML('<>\"&');\n$unescaped  = unescapeHTML('&lt;&gt;&quot;&amp;');\n$qs = querystring();   # get all data in $q as a query string OK for GET\nnocache(1);            # set Pragma: no-cache + expires\nprint header();         # print a simple header\n# get a complex header\n$header = header(   -type       => 'image/gif'\n-nph        => 1,\n-status     => '402 Payment required',\n-expires    =>'+24h',\n-cookie     => $cookie,\n-charset    => 'utf-7',\n-attachment => 'foo.gif',\n-Cost       => '$2.00');\n@cookies = cookie();        # get names of all available cookies\n$value   = cookie('foo')    # get first value of cookie 'foo'\n@value   = cookie('foo')    # get all values of cookie 'foo'\n# get a cookie formatted for header() method\n$cookie  = cookie(  -name    => 'Password',\n-values  => ['superuser','god','my dog woofie'],\n-expires => '+3d',\n-domain  => '.nowhere.com',\n-path    => '/cgi-bin/database',\n-secure  => 1 );\nprint header( -cookie=>$cookie );       # set cookie\nprint redirect('http://go.away.now');   # print a redirect header\ndienice( cgierror() ) if cgierror();",
    "sections": {
        "NAME": {
            "content": "CGI::Simple::Standard - a wrapper module for CGI::Simple that provides a function style\ninterface\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use CGI::Simple::Standard qw( -autoload );\nuse CGI::Simple::Standard qw( :core :cookie :header :misc );\nuse CGI::Simple::Standard qw( param upload );\n\n$CGI::Simple::Standard::POSTMAX = 1024;       # max upload via post 1kB\n$CGI::Simple::Standard::DISABLEUPLOADS = 0;   # enable uploads\n\n@params = param();        # return all param names as a list\n$value =  param('foo');   # return the first value supplied for 'foo'\n@values = param('foo');   # return all values supplied for foo\n\n%fields   = Vars();       # returns untied key value pair hash\n$hashref = Vars();       # or as a hash ref\n%fields   = Vars(\"|\");    # packs multiple values with \"|\" rather than \"\\0\";\n\n@keywords = keywords();   # return all keywords as a list\n\nparam( 'foo', 'some', 'new', 'values' );        # set new 'foo' values\nparam( -name=>'foo', -value=>'bar' );\nparam( -name=>'foo', -value=>['bar','baz'] );\n\nappend( -name=>'foo', -value=>'bar' );          # append values to 'foo'\nappend( -name=>'foo', -value=>['some', 'new', 'values'] );\n\nDelete('foo');   # delete param 'foo' and all its values\nDeleteall();    # delete everything\n\n<INPUT TYPE=\"file\" NAME=\"uploadfile\" SIZE=\"42\">\n\n$files    = upload()                   # number of files uploaded\n@files    = upload();                  # names of all uploaded files\n$filename = param('uploadfile')       # filename of 'uploadfile' field\n$mime     = uploadinfo($filename,'mime'); # MIME type of uploaded file\n$size     = uploadinfo($filename,'size'); # size of uploaded file\n\nmy $fh = $q->upload($filename);     # open filehandle to read from\nwhile ( read( $fh, $buffer, 1024 ) ) { ... }\n\n# short and sweet upload\n$ok = upload( param('uploadfile'), '/path/to/write/file.name' );\nprint \"Uploaded \".param('uploadfile').\" and wrote it OK!\" if $ok;\n\n$decoded    = urldecode($encoded);\n$encoded    = urlencode($unencoded);\n$escaped    = escapeHTML('<>\"&');\n$unescaped  = unescapeHTML('&lt;&gt;&quot;&amp;');\n\n$qs = querystring();   # get all data in $q as a query string OK for GET\n\nnocache(1);            # set Pragma: no-cache + expires\nprint header();         # print a simple header\n# get a complex header\n$header = header(   -type       => 'image/gif'\n-nph        => 1,\n-status     => '402 Payment required',\n-expires    =>'+24h',\n-cookie     => $cookie,\n-charset    => 'utf-7',\n-attachment => 'foo.gif',\n-Cost       => '$2.00');\n\n@cookies = cookie();        # get names of all available cookies\n$value   = cookie('foo')    # get first value of cookie 'foo'\n@value   = cookie('foo')    # get all values of cookie 'foo'\n# get a cookie formatted for header() method\n$cookie  = cookie(  -name    => 'Password',\n-values  => ['superuser','god','my dog woofie'],\n-expires => '+3d',\n-domain  => '.nowhere.com',\n-path    => '/cgi-bin/database',\n-secure  => 1 );\nprint header( -cookie=>$cookie );       # set cookie\n\nprint redirect('http://go.away.now');   # print a redirect header\n\ndienice( cgierror() ) if cgierror();\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module is a wrapper for the completely object oriented CGI::Simple module and provides a\nsimple functional style interface. It provides two different methods to import function names\ninto your namespace.\n",
            "subsections": [
                {
                    "name": "Autoloading",
                    "content": "If you specify the '-autoload' pragma like this:\n\nuse CGI::Simple::Standard qw( -autoload );\n\nThen it will use AUTOLOAD and a symbol table trick to export only those subs you actually call\ninto your namespace. When you specify the '-autoload' pragma this module exports a single\nAUTOLOAD subroutine into you namespace. This will clash with any AUTOLOAD sub that exists in the\ncalling namespace so if you are using AUTOLOAD for something else don't use this pragma.\n\nAnyway, when you call a subroutine that is not defined in your script this AUTOLOAD sub will be\ncalled. The first time this happens it will initialize a CGI::Simple object and then apply the\nrequested method (if it exists) to it. A fatal exception will be thrown if you try to use an\nundefined method (function).\n"
                },
                {
                    "name": "Specified Export",
                    "content": "Alternatively you can specify the functions you wish to import. You can do this on a per\nfunction basis like this:\n\nuse CGI::Simple::Standard qw( param upload querystring Dump );\n\nor utilize the %EXPORTTAGS that group functions into related groups. Here are the groupings:\n\n%EXPORTTAGS = (\n':html'     => [ qw(:misc) ],\n':standard' => [ qw(:core :access) ],\n':cgi'      => [ qw(:core :access) ],\n':all'      => [ qw(:core :misc :cookie :header :push :debug :cgi-lib\n:access :internal) ],\n':core'     => [ qw(param addparam paramfetch urlparam keywords\nappend Delete deleteall Deleteall upload\nquerystring parsequerystring  parsekeywordlist\nVars saveparameters restoreparameters) ],\n':misc'     => [ qw(urldecode urlencode escapeHTML unescapeHTML put) ],\n':cookie'   => [ qw(cookie rawcookie) ],\n':header'   => [ qw(header cache nocache redirect) ],\n':push'     => [ qw(multipartinit multipartstart multipartend\nmultipartfinal) ],\n':debug'    => [ qw(Dump asstring cgierror cgiobject) ],\n':cgi-lib'  => [ qw(ReadParse SplitParam MethGet MethPost MyBaseUrl MyURL\nMyFullUrl PrintHeader HtmlTop HtmlBot PrintVariables\nPrintEnv CgiDie CgiError Vars) ],\n':ssl'      => [ qw(https) ],\n':access'   => [ qw(version nph allparameters charset crlf globals\nauthtype contentlength contenttype documentroot\ngatewayinterface pathtranslated referer remoteaddr\nremotehost remoteident remoteuser requestmethod\nscriptname servername serverport serverprotocol\nserversoftware username useragent virtualhost\npathinfo Accept http https protocol url selfurl\nstate) ],\n':internal' => [ qw(initializeglobals usecgipmglobalsettings\nstoreglobals resetglobals) ]\n);\n\nThe familiar CGI.pm tags are available but do not include the HTML functionality. You specify\nthe import of some function groups like this:\n\nuse CGI::Simple::Standard qw( :core :cookie :header );\n\nNote that the function groups all start with a : char.\n"
                },
                {
                    "name": "Mix and Match",
                    "content": "You can use the '-autoload' pragma, specifically named function imports and tag group imports\ntogether if you desire.\n\n$POSTMAX and $DISABLEUPLOADS\nIf you wish to set $POSTMAX or $DISABLEUPLOADS you must do this *after* the use statement and\n*before* the first function call as shown in the synopsis.\n\nUnlike CGI.pm uploads are disabled by default and the maximum acceptable data via post is capped\nat 102400kB rather than infinity. This is specifically to avoid denial of service attacks by\ndefault. To enable uploads and to allow them to be of infinite size you simply:\n\n$CGI::Simple::Standard::POSTMAX = -1;         # infinite size upload\n$CGI::Simple::Standard::$DISABLEUPLOADS = 0;  # enable uploads\n\nAlternatively you can specify the CGI.pm default values as shown above by specifying the\n'-default' pragma in your use statement.\n\nuse CGI::Simple::Standard qw( -default ..... );\n"
                }
            ]
        },
        "EXPORT": {
            "content": "Nothing by default.\n\nUnder the '-autoload' pragma the AUTOLOAD subroutine is exported into the calling namespace.\nAdditional subroutines are only imported into this namespace if you physically call them. They\nare installed in the symbol table the first time you use them to save repeated calls to\nAUTOLOAD.\n\nIf you specifically request a function or group of functions via an EXPORTTAG then stubs of\nthese functions are exported into the calling namespace. These stub functions will be replaced\nwith the real functions only if you actually call them saving wasted compilation effort.\n",
            "subsections": []
        },
        "FUNCTION DETAILS": {
            "content": "This is a wrapper module for CGI::Simple. Virtually all the methods available in the OO\ninterface are available via the functional interface. Several method names are aliased to\nprevent namespace conflicts:\n\n$q->delete('foo')   =>  Delete('foo')\n$q->deleteall      =>  Deleteall() or deleteall()\n$q->save(\\*FH)      =>  saveparameters(\\*FH)\n$q->accept()        =>  Accept()\n\nAlthough you could use the new() function to genrate new OO CGI::Simple objects the",
            "subsections": [
                {
                    "name": "restore_parameters",
                    "content": "underlying CGI::Simple object for the functional interface.\n"
                },
                {
                    "name": "restore_parameters",
                    "content": "to it such as query strings, hashes and file handles to re-initialize your underlying object.\n\n$q->new CGI::Simple()                => restoreparameters()\n$q->new CGI::Simple({foo=>'bar'})    => restoreparameters({foo=>'bar'})\n$q->new CGI::Simple($querystring)   => restoreparameters($querystring)\n$q->new CGI::Simple(\\*FH)            => restoreparameters(\\*FH)\n\nFor full details of the available functions see the CGI::Simple docs. Just remove the $q-> part\nand use the method name directly.\n"
                }
            ]
        },
        "BUGS": {
            "content": "As this is 0.01 there are almost bound to be some.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Dr James Freeman <jfreeman@tassie.net.au> This release by Andy Armstrong <andy@hexten.net>\n\nThis package is free software and is provided \"as is\" without express or implied warranty. It\nmay be used, redistributed and/or modified under the terms of the Perl Artistic License (see\nhttp://www.perl.com/perl/misc/Artistic.html)\n\nAddress bug reports and comments to: andy@hexten.net\n",
            "subsections": []
        },
        "CREDITS": {
            "content": "The interface and key sections of the CGI::Simple code come from CGI.pm by Lincoln Stein.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "CGI::Simple which is the back end for this module, CGI.pm by Lincoln Stein\n",
            "subsections": []
        }
    },
    "summary": "CGI::Simple::Standard - a wrapper module for CGI::Simple that provides a function style interface",
    "flags": [],
    "examples": [],
    "see_also": []
}