UPDATE: storing them in an array reference is not necessary, i just wanted to show how to do so. :) But you do have to store the hashes as reference or else they will 'flatten' into the array that contains them.use strict; my %one; my %two; my %three; my $hashes = [\%one, \%two, \%three]; for (@$hashes) { for my $k (keys %$_) { #do something } }
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to (jeffa) Re: foreach keys over multiple hashes
by jeffa
in thread foreach keys over multiple hashes
by c
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |