in reply to Number notation

because 2 == 02 is in numeric context. $array{$var2} is in string context. Just add int to the code like such:
print $array{int($var2)}

The 15 year old, freshman programmer,
Stephen Rawls

Replies are listed 'Best First'.
Re: Re: Number notation
by Michalis (Pilgrim) on Jun 21, 2001 at 00:41 UTC
    Thanks, the usage of int() is a solution, and probably the one I'll follow (although, the hash is so small that i'ld be probably better to just add the extra keys :-)