Welcome to the Monastery | |
PerlMonks |
Re: Closure questionby fletcher_the_dog (Friar) |
on Mar 02, 2004 at 18:05 UTC ( [id://333321]=note: print w/replies, xml ) | Need Help?? |
I have run into this problem before and it has to do with the fact that the statement "my @r=..." hasn't been executed yet. Perl lets you use the @r under strict because your definition for "doesnt_work" is within the lexical scope of @r. But it does not automatically execute code just because it uses a variable that might possible be in a closure or just because it is in a block that contains a definition of a sub.
In Section
Seekers of Perl Wisdom
|
|