in reply to Re: how can i return the common keys from a hash
in thread how can i return the common keys from a hash
in scalar context, each returns the next key of the hash. Why doesn't, then, the assignment "my $m = each %$href" return false if the key is "0"? ie
> perl -wle 'my %a = ( 0 => 1, y => 2, z => 4); while (my $m = each %a +) { print $m }' y 0 z > perl -wle 'my @a = ( 0 => 1, y => 2, z => 4); while (my $m = pop @a) + { print $m }' 4 z 2 y 1 > perl -wle 'my @a = ( 0 => 1, y => 2, z => 4); while (my $m = shift @ +a) { print $m }' >
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: how can i return the common keys from a hash
by imp (Priest) on Aug 05, 2006 at 01:42 UTC | |
by ivancho (Hermit) on Aug 05, 2006 at 02:07 UTC |