in reply to Re: Inner subroutines?
in thread Inner subroutines?
It's the reason why you cannot use "my" variables in the top level of source files for mod_perl, when using Apache::Registry, the easy route from CGI to mod_perl.
There are articles on how to fix variables for inner subroutines, but the fact that you even need to worry about it is a major counterpoint against Perl, in my opinion.
The reason, as far as I gather, is because BEGIN (and related) blocks are actually subs, that are executed once; you can even use the syntax
and subs defined in BEGIN blocks are global subs.sub BEGIN { ... }
And, Larry Wall and other prominent figures have said, years ago, that it'll never be "fixed". Because it is so by design.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Inner subroutines?
by ikegami (Patriarch) on Feb 11, 2011 at 17:39 UTC |