|
|
| Do you know where your variables are? | |
| PerlMonks |
Re: NEWBIE Brain Teaser #2, by nysusby snafu (Chaplain) |
| on Apr 16, 2001 at 04:22 UTC ( [id://72765]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Well, I cheated and ran the script to see what would happen. But I will offer a guessed explanation. The first script I ran was as is shown above. My output was:
B: I believe the output was this way because when the subroutine C: On the other hand when you change the subroutine(); to &subroutine; it printed:
The reason this occurred is because when calling a subroutine
I admit, lexical scope vs dynamic scope is still confusing to me and
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||