It's possible that some of your code or the modules that you use

either misuse


$^W or trap $SIG{__WARN__} which prevents from warnings to be printed.

grep


for these two things.


Remember - there's only the code I showed you. No other modules (other
than Template, strict and warnings which are use()d in index.cgi) and no
other code than the index.cgi I sent you.

You did load things in startup.pl, remember? some module could override $SIG{__WARN__}. Don't load those modules if you don't need them.


You could also try to reset it in your code:

perl -wle '$SIG{__WARN__} = sub {}; $SIG{__WARN__} = sub {CORE::warn(@_)}; warn "foo"'
foo at -e line 1.


but you need to do that in the BEGIN block, so it'll happen before the compilation of the rest of the code is done:

BEGIN {
  $SIG{__WARN__} = sub {CORE::warn(@_)};
}
use strict;
use warnings;

the rest of your code

In any case your problem with variables not staying shared (even though you can't see it reported is easy to see).
http://perl.apache.org/docs/general/perl_reference/perl_reference.html#my___Scoped_Variable_in_Nested_Subroutines


You also don't want to initialize $template on every request, see the Template docs/list archive to how make it more efficient (which will also remove the my() problem).

make $vars and $config global as one of the workarounds.

So if on your side there are warnings and not on my side, with the same
code, then that's a problem too...

Yes, especially since you have a scoped warnings enabled explicitly in your file. Does you perl print this warnings when you run a test script from the above URL?


Now that I think of it, when I started testing mod_perl (back when my
code was not correct and I was fixing errors to make it work), I
remember that Apache::Reload didn't seem to want to reload my modules.
Even with the ReloadDebug variable on, nothing was ever printed to my
error_log saying that my modules were reloaded... So the warnings issue
could be related to this too.

because it probably couldn't find them. See: http://perl.apache.org/docs/2.0/api/Apache/Reload.html#Description or even this: http://perl.apache.org/docs/2.0/api/Apache/Reload.html#Problems_With_Reloading_Modules_Which_Do_Not_Declare_Their_Package_Name


__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com



Reply via email to