Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > d46e4ed929175b06d5ad5b49a16d97a3 > files > 7

perl-WWW-Mechanize-CGI-0.300.0-3.mga4.noarch.rpm

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

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 ] )
        Additional environment variables to be used in CGI.

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

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

SEE ALSO
    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.