Your choice of data structure is poor. Whenever you are using to hashes with the same keys, you should think about using a hash of hashes, or hash of arrays, or whatever suits uour needs the best.
However, since you have the same keys you could do something like this:
for $user (sort keys %hash) { print "$user: @{$hash{$user}} \t"; print "$loc: @{$location{$loc}} \n"; }
EDIT: my copy and paste was too hasty (the train from which I posted it was arriving at my destination). It should be something like this:
for $user (sort keys %hash) { print "$user: @{$hash{$user}} \t"; print "$user: @{$location{$user}} \n"; }
In reply to Re: how to iterate over multiple hashes with same key value
by Laurent_R
in thread how to iterate over multiple hashes with same key value
by sunil9009
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |