use strict; my %one; my %two; my %three; my @hashes = qw(one two three); for my $i(@hashes) { for my $j(keys %$i) { #do something } }