Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I'll bring this up on the mod_perl dev list. I don't think we should advise people to use such a crazy construct. The problems people encounter with ModPerl::Registry are usually not caused by inner subroutines, but rather by closures. The closures were always there, but were never noticed before in a non-persistent environment. Consider this:
This code will break when run in mod_perl because it forms a closure around $q, making it a private variable for the show_name() sub after compilation. This problem can be fixed by making $q an our variable, but that's a poor programming practice, giving $q a large scope and persistence that it should not have. The correct fix is to pass the variables that the sub requires:
In reply to Re^5: OUR declaration
by perrin
|
|