in reply to Number notation
sets up a hash with 2 keys, 1 and 2. The values of which are 30 and 125 respectively. If you wrote it as such it might be more visible..my %array = (1, 30, 2, 125);
You are querying the hash with keys of "02" and "2" from your splits. There is no key "02", since this is different from simply "2", thus "undef". There is a key "2" and you get the value of it "125".my %array = ( 1 => 30, 2 => 125);
Your statement 2 == 02 is true, however the keys of a hash are treated as strings and "2" eq "02" is false.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Number notation
by Michalis (Pilgrim) on Jun 21, 2001 at 00:37 UTC |