K
Kjetil Skotheim
I'm having trouble understanding something in mod_perl. The sub handler is:
sub handler
{
...stuff deleted...
my $var=1 if ...condition_A...;
$var=2 if ...condition_B...; if($var){
...someting....
}
}
The IF-block are entered sometimes when both condition_A and B
are false! How can that be? If I do the following instead then
everyting works ok:
my $var; #lexical declaration without if
$var=1 if ...condition_A...;
$var=2 if ...condition_B...;
I suspect that $var is preserved from the previous apache-request
on the same process. Can anyone confirm this?
Should "my $var=... if ..." be totally avoided in mod_perl?
sub handler
{
...stuff deleted...
my $var=1 if ...condition_A...;
$var=2 if ...condition_B...; if($var){
...someting....
}
}
The IF-block are entered sometimes when both condition_A and B
are false! How can that be? If I do the following instead then
everyting works ok:
my $var; #lexical declaration without if
$var=1 if ...condition_A...;
$var=2 if ...condition_B...;
I suspect that $var is preserved from the previous apache-request
on the same process. Can anyone confirm this?
Should "my $var=... if ..." be totally avoided in mod_perl?