|Perl Monk, Perl Meditation|
hash assignment wierdnessby Bro. Doug (Monk)
|on Apr 20, 2007 at 15:29 UTC||Need Help??|
Bro. Doug has asked for the wisdom of the Perl Monks concerning the following question:
I understand that undef() and hashes are not meant for each other. That said, I was wondering if anyone could specifically explain the wierdness occurring when you run the following piece of code.
It seems to me that the hash is undefined until you try to assign something to it, and it doesn't matter what that something is. Also, I'm confused as to why, in this case, using undef as a function actually performs the undefine on the hash.
I've followed advice and added use warnings and use strict (this started as a perl -e that was being passed around my office). We've also used Data::Dumper on it, just for play.
Bro. Doug :wq