[cgiapp] CGI::Application::Dispatch implementation

Bruce McKenzie bruce at 2MinuteExplainer.com
Fri Feb 15 18:34:17 EST 2008


Michael Peters wrote in an email message dated 2/15/2008 5:00 PM:
> Is your module's package called "Modules::Notify" or just "Notify"? If it's the
> first then change your "use lib" line to:
> 
>   use lib $Bin;
> 
> If it's the latter, then you don't need a prefix at all:
> 
>   CGI::Application::Dispatch->dispatch();
> 

Thanks Michael. Any way I name it, I get a Not Found.

I tried this:
   #!/usr/bin/perl
   use strict;
   use FindBin qw($Bin);
   use lib "$Bin/../perl_lib"; # my standard lib
   use lib "$Bin/Modules"; # lib for this webapp
   use CGI::Application::Dispatch;
...
   my $name = CGI::Application::Dispatch->translate_module_name();
   print ($name || "No name found"); # prints "No name found"
   CGI::Application::Dispatch->dispatch(debug=>1) ; #Not Found

FWIW, this works as expected:

   #!/usr/bin/perl
   use strict;
   use FindBin qw($Bin);
   use lib "$Bin/../perl_lib";  # my standard lib
   use lib "$Bin/Modules"; # lib for this webapp

   use Notify;
   Notify->new->run(); #default runmode is 'test'



-- 
Bruce McKenzie

http://www.2MinuteExplainer.com


More information about the cgiapp mailing list