GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  WWW::MECHANIZE::CGI (3)

.ds Aq ’

NAME

WWW::Mechanize::CGI - Use WWW::Mechanize with CGI applications.

CONTENTS

SYNOPSIS



    use CGI;
    use WWW::Mechanize::CGI;
   
    # Using a external CGI application
   
    $mech = WWW::Mechanize::CGI->new;
    $mech->cgi_application(/path/to/cgi/executable.cgi);
   
    $response = $mech->get(http://localhost/);
   
   
    # Using a inline CGI callback
   
    $mech = WWW::Mechanize::CGI->new;
    $mech->cgi( sub {
       
        my $q = CGI->new;
       
        print $q->header,
              $q->start_html(Hello World),
              $q->h1(Hello World),
              $q->end_html;
    });
   
    $response = $mech->get(http://localhost/);



DESCRIPTION

Provides a convenient way of using CGI applications with WWW::Mechanize.

METHODS

new Behaves like, and calls, WWW::Mechanize’s new method. Any parms passed in get passed to WWW::Mechanize’s constructor.
cgi Coderef to be used to execute the CGI application.
cgi_application(’/path/to/cgi/executable.cgi’) Path to CGI executable.
env( [, key => value ] ) Set/Get additional environment variables to be used in CGI. Takes a hash and returns a hash.



    $mech->env( DOCUMENT_ROOT => /export/www/myapp );



fork Set to a true value if you want to fork() before executing CGI.

SEE ALSO

Test::WWW::Mechanize::CGI
WWW::Mechanize
LWP::UserAgent
HTTP::Request::AsCGI

AUTHOR

Christian Hansen, ch@ngmedia.com

LICENSE

This library is free software. You can redistribute it and/or modify it under the same terms as perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 WWW::MECHANIZE::CGI (3) 2005-12-11

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.