{
    "mode": "perldoc",
    "parameter": "HTTP::Server::Simple::CGI",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/HTTP%3A%3AServer%3A%3ASimple%3A%3ACGI/json",
    "generated": "2026-06-16T00:39:40Z",
    "sections": {
        "NAME": {
            "content": "HTTP::Server::Simple::CGI - CGI.pm-style version of HTTP::Server::Simple\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "HTTP::Server::Simple was already simple, but some smart-ass pointed out that there is no CGI in\nHTTP, and so this module was born to isolate the CGI.pm-related parts of this handler.\n\naccepthook\nThe accepthook in this sub-class clears the environment to the start-up state.\n\npostsetuphook\nInitializes the global CGI object, as well as other environment settings.\n\ncgiclass [Classname]\nGets or sets the class to use for creating the $cgi object passed to \"handlerequest\".\n\nCalled with a single argument, it sets the coderef. Called with no arguments, it returns this\nfield's current value.\n\nTo provide an initialization subroutine to be run in the postsetuphook, see \"cgiinit\".\n\ne.g.\n\n$server->cgiclass('CGI');\n\n$server->cgiinit(sub {\nrequire CGI;\nCGI::initializeglobals();\n});\n\nor, if you want to use CGI::Simple,\n\n$server->cgiclass('CGI::Simple');\n$server->cgiinit(sub {\nrequire CGI::Simple;\n});\n\ncgiinit [CODEREF]\nA coderef to run in the postsetuphook.\n\nCalled with a single argument, it sets the coderef. Called with no arguments, it returns this\nfield's current value.\n\nsetup\nThis method sets up CGI environment variables based on various meta-headers, like the protocol,\nremote host name, request path, etc.\n\nSee the docs in HTTP::Server::Simple for more detail.\n\nhandlerequest CGI\nThis routine is called whenever your server gets a request it can handle.\n\nIt's called with a CGI object that's been pre-initialized. You want to override this method in\nyour subclass\n\nhandler\nHandler implemented as part of HTTP::Server::Simple API\n",
            "subsections": []
        }
    },
    "summary": "HTTP::Server::Simple::CGI - CGI.pm-style version of HTTP::Server::Simple",
    "flags": [],
    "examples": [],
    "see_also": []
}