|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re: How to access outside variableby biohisham (Priest) |
| on Jan 21, 2011 at 10:45 UTC ( #883504=note: print w/ replies, xml ) | Need Help?? |
|
Since $a is defined in the same package - main - what happens is that the value of $a gets merely overwritten, variables in the same package are global to that package scope, look up __PACKAGE__ in perlmod and perldata, coping with scoping can be a good read as well.. Excellence is an Endeavor of Persistence. A Year-Old Monk :D .
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||