[cgiapp] CGI::Application::Dispatch problem
    Brad Van Sickle 
    bvansickle3 at gmail.com
       
    Tue Apr 27 15:12:40 EDT 2010
    
    
  
I'm trying to play around with CGI::Application::Dispatch a bit and I'm 
having some trouble getting it working and I'm hoping someone who has 
experience with this module can offer some advice.
I have subclassed CGI::Application::Dispatch as follows:
    package MyDispatch;
    use base 'CGI::Application::Dispatch';
    sub dispatch_args {
        return {
            prefix  => 'public::Packages',
            table   => [
                ''                => { app => 'PublicSite', rm => 
'Content' },
            ],
            }
        };
    }
    1;
In my Apache config I have:
Alias /dispatchperl /home/user/dev_html/perl/
<Location /dispatchperl>
        SetHandler perl-script
        PerlHandler MyDispatch
</Location>
When I attempt to hit the URI /dispatchperl, my module seems to be 
getting invoked.  But I get the following error:
[Tue Apr 27 11:58:35 2010] -e: [Dispatch] ERROR for request 
'/dispatchperl/': Can't locate object method "new" via package 
"public::Packages::PublicSite" at 
/usr/lib/perl5/site_perl/5.8.8/CGI/Application/Dispatch.pm line 702.
[Tue Apr 27 11:58:35 2010] -e:
I am able to run that module with a standard instance script just fine:
use PublicSite;
local our $app = PublicSite->new();
$app->run();
    
    
More information about the cgiapp
mailing list