Can you explain this syntax then, that is used with foreach loops?
foreach my $i (keys %{$x}) { ... }
Why don't we use foreach my $i (keys $$x){... }?
What is the name for this syntax: "(keys %{$x})"?
Oops, sorry, I meant to get to that and I just rambled on until I forgot. Sorry.
The trick here isn't that it's in a foreach loop. Foreach just iterates over any list. You're using the keys() built-in to return a list of the keys for a given hash. Keys requires that it is passed a hash. Thus, if we have a reference to a hash, we have to dereference to the entire hash, not a scalar inside of it. That's why we use %{$x} or more simply %$x. You do the same thing in one of your other loops when you dereference the whole array to get a list to iterate over.
Hope that helps.
James
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]