|
HTTP::Request::AsCGI - Setup a CGI enviroment from a HTTP::Request |
HTTP::Request::AsCGI - Setup a CGI enviroment from a HTTP::Request
use CGI;
use HTTP::Request;
use HTTP::Request::AsCGI;
my $request = HTTP::Request->new( GET => 'http://www.host.com/' );
my $stdout;
{
my $c = HTTP::Request::AsCGI->new($request)->setup;
my $q = CGI->new;
print $q->header,
$q->start_html('Hello World'),
$q->h1('Hello World'),
$q->end_html;
$stdout = $c->stdout;
# enviroment and descriptors will automatically be restored
# when $c is destructed.
}
while ( my $line = $stdout->getline ) {
print $line;
}
=head1 DESCRIPTION
Provides a convinient way of setting up an CGI enviroment from a HTTP::Request.
Thomas L. Shinnick for his valuable win32 testing.
Christian Hansen, ch@ngmedia.com
This library is free software. You can redistribute it and/or modify it under the same terms as perl itself.
|
HTTP::Request::AsCGI - Setup a CGI enviroment from a HTTP::Request |