in reply to Hash becomes uninitalized without warning... with warning

No, the hash hasn't disappeared.

As wind's reply shows, if the input, $t is 1, you'll get Rekjavik back... but consider what happens if the input is "2," "3" or "42."

say $p{$t};
    is the same thing as
say $p{1};
    when the input is "1" but if you wish to extend your hash with a new key-value pair you'll have to add instructions to do so.

Replies are listed 'Best First'.
Re^2: Hash becomes uninitalized without warning... with warning
by perl-diddler (Chaplain) on Apr 14, 2011 at 02:16 UTC
    I think he was wondering why, when input a value of "1", at the terminal, it wasn't matching his data value.

    I don't think he was trying to handle cases asking for the answer of everything -- just trying to get a basic understanding of why his test case wasn't working, in what would seem to many new perl programmers, to be such a simple case! And who among us haven't been bitten by that simple newline more than once! :-)