On Nov 11, 2003, at 2:08 PM, Christiane Nerz wrote:

Nope - 'cause if I print out the values key for key, I get all four:

my $array = keys %hash;

print $hash{$array[0]};
print"\n";
print $hash{$array[1]};
print"\n";
print $hash{$array[2]};
print"\n";
print $hash{$array[3]};

With the code
foreach (keys %hash) {
        print $hash{$_};
        print "\n";}

I only get the value corresponding to $hash{$array[3]}.

As near as I can tell, the above two chunks of code have identical effects. If you put the first chunk in the program EXACTLY where the foreach() loop is you see all of them?


James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to