|Perl Monk, Perl Meditation|
An eighth use of localby rinceWind (Monsignor)
|on Dec 01, 2005 at 14:49 UTC||Need Help??|
Musing on Mark Jason Dominus's Seven Useful Uses of local, I think I've come up with another one.
The most common use I have for local is with %ENV. The article doesn't specifically mention environment variables. There are instances where I am doing one of the following:
Thinking about it more, I would suggest that @ARGV belongs in the same category, as used in the file slurp idiom:
There's also localising @ARGV for handling INCLUDE directives in the input stream.
These uses of local could be thought of as a special case of number 6 (Dynamic Scope Revisited), or possibly number 1 (Special Variables), but I think they are a new category.
Update:Looks like there might be a problem with plover.com - try this link as an alernative for MJD's article.