[cgiapp] CAD::Server strangeness

Richard Jones ra.jones at dpw.clara.co.uk
Thu Sep 11 06:42:58 EDT 2008


Using CGI::Application::Dispatch::Server, I'm getting a weird phenomenon 
occurring:

my $server = CGI::Application::Dispatch::Server->new(
     class    => 'MyWebApp::Dispatch',
     root_dir => '/path/to/htdocs',
);

$server->run;

Server starts OK. But with debug set I get the following console output 
with every request:

[Dispatch] Final args to pass to new(): $VAR1 = {
     'TMPL_PATH' => [
         '/path/to/templates',
         '/path/to/templates',
         '/path/to/templates',
         '/path/to/templates',
         '/path/to/templates',
         '/path/to/templates',
     ],
     'PARAMS' => {
         foo => 'bar, etc,
     },
},

This '/path/to/templates' output can be repeated over a few lines only, 
or indefinitely until I kill & re-start the server. It also hammers 
system resources. No web content appears until the repeating output 
stops and '[Dispatch] creating instance of MyWebApp::Foo' appears.

My dispatch_args are pretty standard:
{
     prefix  => 'MyWebApp',
     default => 'foo',
     debug => 1,
     args_to_new => {
        PARAMS => {
             cfg_file => 'path/to/config.pl',
        },
        TMPL_PATH => [ 'path/to/templates' ], # tried as scalar as well
     },
     table   => [
         :app/:rm' => {  }, etc,
     ],
}

It's only ever the TMPL_PATH content that gets repeated, never PARAMS. 
And it's not a potential error in the table arrayref as I can configure 
dispatch_args with no table entry, and the problem's still there.

Has anyone seen this before, or any idea what's causing it?


More information about the cgiapp mailing list