in reply to Number notation

Well..
my %array = (1, 30, 2, 125);
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".

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
    <Quote>
    Your statement 2 == 02 is true, however the keys of a hash are treated as strings and "2" eq "02" is false.
    </Quote>

    Actually that was the only thing I 've read so far, and I wasn't aware of, and that's the answer to the problem. Thanks.
    Well, learning while aging is a good thing anyway:)