good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
What you don't understand is that perl compiles that sub foo and compiles the lexical-ness of the my declarations before it executes the foo() and before it sets those lexicals below the function call.
I think it's clearer like this. It's nearly the same thing, but it doesn't have the lexical masking that yours has. That just confuses the issue.
Here you can clearly see I'm using the foo and berries declared lexically after the function is called. The declaration happens at compile time and the initialization happens at runtime. -Paul In reply to Re: What is it I don't understand about perl scoping?
by jettero
|
|