2 HTTP::Request::AsCGI - Setup a CGI enviroment from a HTTP::Request
10 use HTTP::Request::AsCGI;
12 my $request = HTTP::Request->new( GET => 'http://www.host.com/' );
16 my $c = HTTP::Request::AsCGI->new($request)->setup;
20 $q->start_html('Hello World'),
21 $q->h1('Hello World'),
26 # enviroment and descriptors will automatically be restored
27 # when $c is destructed.
30 while ( my $line = $stdout->getline ) {
35 Provides a convinient way of setting up an CGI enviroment from a
39 new ( $request [, key => value ] )
40 Contructor, first argument must be a instance of HTTP::Request
41 followed by optional pairs of environment key and value.
44 Returns a hashref containing the environment that will be used in
45 setup. Changing the hashref after setup has been called will have no
49 Setups the environment and descriptors.
52 Restores the enviroment and descriptors. Can only be called after
56 Returns the request given to constructor.
59 Returns a HTTP::Response. Can only be called after restore.
62 Accessor for handle that will be used for STDIN, must be a real
63 seekable handle with an file descriptor. Defaults to a tempoary
67 Accessor for handle that will be used for STDOUT, must be a real
68 seekable handle with an file descriptor. Defaults to a tempoary
72 Accessor for handle that will be used for STDERR, must be a real
73 seekable handle with an file descriptor.
76 examples directory in this distribution.
78 Test::WWW::Mechanize::CGI
81 Thomas L. Shinnick for his valuable win32 testing.
84 Christian Hansen, "ch@ngmedia.com"
87 This library is free software. You can redistribute it and/or modify it
88 under the same terms as perl itself.