Perl Monk, Perl Meditation | |
PerlMonks |
Re: Hash element that won't print. Perl Bug???by kjherron (Pilgrim) |
on Oct 10, 2001 at 09:14 UTC ( [id://117932]=note: print w/replies, xml ) | Need Help?? |
The 00 in the term $hash{00} is initially evaluated as a number, rather than a string, because it's not in quotes. Perl then converts the number back into a string to store into the hash. As a result, the assignment
actually stores into $hash{"0"}, not $hash{"00"}. Later, when you try to access $hash{0 . "0"}, you do access $hash{"00"}, which of course is not the same as $hash{"0"}.
In Section
Seekers of Perl Wisdom
|
|