PApp::CGI - use PApp in a CGI environment
use PApp::CGI; # initialize request and do initialization init PApp::CGI and PApp::config_eval { configure PApp ...; $handler = mount_app "admin"; configured PApp; }; # then for each request do &$handler;
This module can be used to run PApp applications in CGI environments e.g. using CGI::SpeedyCGI or plain CGI. The startup-penalty for PApp is immense (a second or so) and is dominated by compilation time, so while PApp is usable with "pure" CGI in some applications a CGI-Accelerator that keeps application in memory is certainly recommended.
The $PApp::request-object (as returned by new <PApp::CGI::Request>) is mostly compatible to Apache, except for missing methods (which could be added quite easily on request).
$PApp::request
This class only contains one user-visible-method: init.
init
This method should be called once for each request, to initialize the request structure. It also checks wether this is the first request served by this process and returns true. For all subsequent requests it returns false. This can be used to configure PApp once.
This class implements the $request object required by a PApp handler. The methods in this class are mostly identical to the methods supported by the Apache module.
$request
This expands the relative url into an absolute one and generates an external redirect.
Reads file/pipe/whatever specified with $filehandle (not a fd!) and outputs it until it is exhausted.
$filehandle
This class implements the connection object returned by $request-connection). The methods in this class are mostly identical to the methods supported by the connection object in the Apache module.
$request-
Marc Lehmann <schmorp@schmorp.de> http://home.schmorp.de/
To install PApp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PApp
CPAN shell
perl -MCPAN -e shell install PApp
For more information on module installation, please visit the detailed CPAN module installation guide.