Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

HTTP::Server::Simple::CGI

Name HTTP::Server::Simple::CGI
Version
Located at /usr/share/perl5/vendor_perl
File /usr/share/perl5/vendor_perl/HTTP/Server/Simple/CGI.pm
Is Core No
Search CPAN for this module HTTP::Server::Simple::CGI
Documentation HTTP::Server::Simple::CGI
Module Details HTTP::Server::Simple::CGI

NAME

HTTP::Server::Simple::CGI - CGI.pm-style version of HTTP::Server::Simple


DESCRIPTION

HTTP::Server::Simple was already simple, but some smart-ass pointed out that there is no CGI in HTTP, and so this module was born to isolate the CGI.pm-related parts of this handler.

accept_hook

The accept_hook in this sub-class clears the environment to the start-up state.

post_setup_hook

Initializes the global CGI object, as well as other environment settings.

cgi_class [Classname]

Gets or sets the class to use for creating the $cgi object passed to handle_request.

Called with a single argument, it sets the coderef. Called with no arguments, it returns this field's current value.

To provide an initialization subroutine to be run in the post_setup_hook, see cgi_init.

e.g.

    $server->cgi_class('CGI');
    $server->cgi_init(sub {
        require CGI;
        CGI::initialize_globals();
    });

or, if you want to use the CGI::Simple manpage,

    $server->cgi_class('CGI::Simple');
    $server->cgi_init(sub {
        require CGI::Simple;
    });

cgi_init [CODEREF]

A coderef to run in the post_setup_hook.

Called with a single argument, it sets the coderef. Called with no arguments, it returns this field's current value.

setup

This method sets up CGI environment variables based on various meta-headers, like the protocol, remote host name, request path, etc.

See the docs in the HTTP::Server::Simple manpage for more detail.

handle_request CGI

This routine is called whenever your server gets a request it can handle.

It's called with a CGI object that's been pre-initialized. You want to override this method in your subclass

handler

Handler implemented as part of HTTP::Server::Simple API

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024