Problems? Is your data what you think it is? | |
PerlMonks |
Re: Hash Printing reveals Hash Memory Locationby tobyink (Canon) |
on Feb 03, 2012 at 01:04 UTC ( [id://951573]=note: print w/replies, xml ) | Need Help?? |
You have:
You want:
Or better yet:
Essentially in that first line, you're adding an entry to the hash where the key is a reference to an anonymous second hash, and the value is undefined. Because you can't use references as hash keys, the reference is stringified (which looks like a memory location). In other words, my %words = {}; is basically a shorthand for:
In Section
Seekers of Perl Wisdom
|
|