|
|
| Just another Perl shrine | |
| PerlMonks |
Re^4: The difference between my and localby ikegami (Pope) |
| on Oct 17, 2006 at 15:11 UTC ( #578803=note: print w/ replies, xml ) | Need Help?? |
|
As you've already been told (by Perl and by fellow monks), you can't use local on a lexical (my) variable. Fellow monks have shown how you can achieve your goal using my instead of local. If you had to use local, then you need to make a package variable by that name first.
You should never have to use this, though. Always use my if possible.
In Section
Tutorials
|
|
||||||||||||||||||||