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
HTTP::Engine::Cookbook(3) User Contributed Perl Documentation HTTP::Engine::Cookbook(3)

HTTP::Engine::Cookbook - How to cook a HTTP::Engine

The biggest advantage of using "HTTP::Engine" is to have one single request handler routine for your application:

    package MyApp;
    use HTTP::Engine::Response;

    sub handle_request {
        my ($request) = @_;
        # ...
        HTTP::Engine::Response->new( body => "Hello World" );
    }

When it comes to deployment, you'll need to write additional handlers or modules based on different server environments.

Deploy your application as a CGI script.

The very basic and simple approach is to deploy your application as a CGI script. To do this, you need to write a CGI program like this:

    ## myapp.cgi
    #!/usr/bin/perl

    use MyApp;
    use HTTP::Engine;
    my $engine = HTTP::Engine->new(
        interface => {
            module => 'CGI',
            request_handler => \&MyApp::handle_request
        }
    );
    $engine->run;

This CGI program can then be placed under the conventional cgi-bin/ directory as those defined in your server configuration.

2011-10-04 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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