in reply to Basic mod-perl question : why my variable is undefined ?
Are you using warnings? Have you checked your logs? If you are getting a warning like
You have scoping problems with your closure. That warning will be issued by code likeVariable "$lig" will not stay shared
sub one { my $x; sub two { print $x; } }
Since mod_perl compiles all your scripts into a dispatch table (as I understand it), it seems plausible to me that the copy of $lig referenced in your compiled copy of xxx() is not the lexically-scoped variable you are working with after your script executes a couple times.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Basic mod-perl question : why my variable is undefined ?
by pcouderc (Monk) on Jul 23, 2014 at 15:47 UTC | |
by kennethk (Abbot) on Jul 23, 2014 at 16:22 UTC | |
by pcouderc (Monk) on Jul 23, 2014 at 17:55 UTC | |
by kennethk (Abbot) on Jul 23, 2014 at 18:48 UTC | |
by pcouderc (Monk) on Jul 24, 2014 at 07:03 UTC |