However when going through a list of variable names to localize from an array, the following does not localize the variables as one (me) would expect.$var = "count"; local $$var;
EDIT: Now I see why it was not working. The variable was then localized to the foreach loop. Hm. Any advice on how I can localize a list of variables in the current scope would be great.foreach (@vars){ $_ =~ s/main:://g; if ($_ !~ m/::/){ if ($_ =~ m/^[a-z]/){ local $$_ = $$_; } } }
In reply to Local $$_? by expresspotato
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |