my( %testA, %testB, %testC ); my @hashrefs = \( %testA, %testB, %testC ); my $i = 0; foreach ( @hashrefs ) { $_->{'key'} = $i; }