Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Re: (Ovid) Re: Sub Definitions Within Subs: Best Way to Exploitby htoug (Deacon) |
on Oct 11, 2001 at 09:15 UTC ( [id://118161]=note: print w/replies, xml ) | Need Help?? |
It does need to be inside another sub. The code has to be something like: which will print abcabc. The change to the $foo variable in the second call does not affect subroutine bar. It has a 'closed', localised and personal $foo variable, that cannot be changed by outside influences - only by bar itself. Thus the name 'closure'.
In Section
Seekers of Perl Wisdom
|
|