Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    CGI::Application::Dispatch 3.07

    Download button

    No screenshots available
    Downloads: 415  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Very Good (4.0/5)
    12 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Michael Peters | More programs
    Perl Artistic License / FREE
    November 1st, 2011, 16:00 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    CGI::Application::Dispatch description

    A Perl module to dispatch requests to CGI::Application based objects

    CGI::Application::Dispatch is a Perl module to dispatch requests to CGI::Application based objects.

    SYNOPSIS

    Out of Box

    Under mod_perl

    < Location /app >
    SetHandler perl-script
    PerlHandler CGI::Application::Dispatch
    < /Location >


    Under normal cgi

    #!/usr/bin/perl
    use strict;
    use CGI::Application::Dispatch;
    CGI::Application::Dispatch->dispatch();


    With a dispatch table

    package MyApp::Dispatch;
    use base 'CGI::Application::Dispatch';

    sub dispatch_args {
    return {
    prefix => 'MyApp',
    table => [
    '' => { app => 'Welcome', rm => 'start' },
    ':app/:rm' => { },
    'admin/:app/:rm' => { prefix => 'MyApp::Admin' },
    ],
    };
    }

    Under mod_perl

    < Location /app >
    SetHandler perl-script
    PerlHandler MyApp::Dispatch
    < /Location >


    Under normal cgi

    #!/usr/bin/perl
    use strict;
    use MyApp::Dispatch;
    MyApp::Dispatch->dispatch();


    This module provides a way (as a mod_perl handler or running under vanilla CGI) to look at the path ($r->path_info or $ENV{PATH_INFO}) of the incoming request, parse off the desired module and it's run mode, create an instance of that module and run it.

    It currently supports both generations of mod_perl (1.x and 2.x). Although, for simplicity, all examples involving Apache configuration and mod_perl code will be shown using mod_perl 1.x. This may change as mp2 usage increases.

    It will translate a URI like this (under mod_perl):

    /app/module_name/run_mode

    or this (vanilla cgi)

    /app/index.cgi/module_name/run_mode

    into something that will be functionally similar to this

    my $app = Module::Name->new(..);
    $app->mode_param(sub {'run_mode'}); #this will set the run mode

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    dispatch requests | CGI::Application objects | Perl module | dispatch | requests | CGI

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM