in reply to how to iterate over multiple hashes with same key value
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to iterate over multiple hashes with same key value
by hdb (Monsignor) on Jul 02, 2013 at 06:31 UTC | |
by Laurent_R (Canon) on Jul 02, 2013 at 13:33 UTC |