[Catalyst] Catalyst weird initialization with Apache

Albert Vila avp at imente.com
Fri Sep 10 15:47:10 GMT 2010


Hello

I made a catalyst plugin and the setup method looks like:

sub setup {
  my $c    = shift;

  use Data::Dumper;
  warn Dumper($c->config);

  ...

  return $c->maybe::next::method(@_);
}

When I restart the apache server, this method is called twice. The
first one, it dumps all the configuration propertly, but the second
one, it only prints the parameters from the __PACKAGE__->config main
method.

I created a dummy catalyst application, just to be sure there wasn't
any problem with my code, and If I insert a warning after the
__PACKAGE__->setup() main method, it is called twice too. Am I doing
something wrong? It has to be something related to the apache
configuration, because if I use the script/test_server.pl it works
fine.

I use the following apache configuration:

PerlSwitches -I /var/web/test/lib
PerlModule test

<Location /test>
  SetHandler perl-script
  PerlHandler test
</Location>

<LocationMatch "/(static|favicon.ico)">
  SetHandler default-handler
</LocationMatch>

the Apache version is Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.2 with
Suhosin-Patch mod_perl/2.0.4 Perl/v5.10.1 configured

Any help would be appreciate.

Thanks

Albert



More information about the Catalyst mailing list