At 06:53 PM 2/8/2006 -0800, Glenn Linderman wrote:
>My understanding is that in a file  foo.pl
>
>my global_foo;
>sub counter { return global_foo++; }
>
>that sub counter is a closure, which probably is even further outside 
>your thought processes-- I was surprised to learn that from Dave, but 
>given the above key chararcteristic, it clearly would be.

Well yeah.  "Closure" just refers to the currently defined context, which is
just as valid for the global scope as a block.  Closure is probably a bad
term for what's really going on.  Probably something like context
definition, or local execution scope is better. ;)


>Named subroutines can be defined in nested scopes, but their own scope 
>is not nested.  Given that definition, they work fine.  If you expect 
>them to have different scopes due to familiarity with languages such as 
>Pascal that implemented nested named subroutines, then you will be 
>surprised.

I highly doubt that some clever perl developer thought this out ahead of
time. More like the law of unintended consequences.  And "a bug? no, it's a
feature".






--
REMEMBER THE WORLD TRADE CENTER         ---=< WTC 911 >=--
"...ne cede malis"

00000100

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to