On Jul 21, Gerard Robin said:

my %h1 = (a => 1, b => 2, c => 3, d => 4, e => 5, f => 6);
[snip]
print "  ", map{ $_." " } @h1{'b'..'e'};
[snip]
@h1{'b'..'e'} = (20, 30, 40, 50);
print "  ", map{ $_." " } @h1{'b'..'e'};

What do you think 'b'..'e' is producing? It's producing the list ('b', 'c', 'd', 'e'), but it has NOTHING to do with the hash. It appears to you that it's returning a list the keys in the hash from 'b' to 'e', but nothing could be further from the truth. Your hash keys aren't stored in the order you placed them in the hash, anyway.

@h3{"Mamadoo".."Lulu"} = (30, 40, 50 );

The list returned by "Mamadoo".."Lulu" is empty.

--
Jeff "japhy" Pinyan         %  How can we ever be the sold short or
RPI Acacia Brother #734     %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %    -- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to