|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re^2: 'local' for imported variables doesn't work as expectedby LanX (Saint) |
| on Oct 04, 2024 at 22:10 UTC ( [id://11162067]=note: print w/replies, xml ) | Need Help?? |
|
> maybe local for hash values was implemented later than local for variables Back in the days when I first learned that local also works for hash elements, I was very surprised. (How random! Why? ¹) But now that I realize that every local is actually operating on hash elements, this finally makes a lot of sense. :) (stash= symbol table hash, and a typeglob is very similar to a hash, just with a fixed number of slots)
Cheers Rolf
Updates¹) And most confusingly, why does it suddenly work for lexical hashes too???
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||