The code:
foreach my $key (sort keys %hash)
creates an anonymous array of the sorted keys in the hash %hash. The foreach is a loop construct, each iteration thru the loop sets $key to the next item in the anonymous array until the end of the array, when the loop ends.
Scott
In reply to Re: Printing hash
by helphand
in thread Printing hash
by tamaguchi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |