[cgiapp] CGI::Application::Dispatch implementation

Bruce McKenzie bruce at 2MinuteExplainer.com
Fri Feb 15 16:51:56 EST 2008


CGI::Application::Dispatch is a favorite plugin of many on this list, 
and it used to be one of mine, but it stopped working in my setup at 
version 2.x. Never figured out why, and I'm OK doing things the 
old-fashioned way, but I thought I'd give it another shot.

Suppose I have:

   directory cgi-bin/admin containing
     a webapp called "test.pl"
     a directory Modules,
           which contains Notify.pm
                which has a run mode "test"

I want to call the following under normal CGI
http://localhost/cgi-bin/admin/test.pl/notify/test

What is the simplest way to write the dispatch app? As I understand the 
documentation, this should do the right thing:

    #!/usr/bin/perl
    use strict;
    use FindBin qw($Bin);
    use lib "$Bin/Modules"; # add "Modules" dir to @INC just in case	
    use CGI::Application::Dispatch();

    CGI::Application::Dispatch->dispatch(prefix=>"Modules");


But, obviously, I don't understand the documentation, because, this, and 
every other attempt at it produces only a "Not Found" error.

thx,


-- 
Bruce McKenzie
Business Information Graphics

212-477-4288
http://www.2MinuteExplainer.com


More information about the cgiapp mailing list