my @words = qw( red blue peony ); for my $i ( 1.. $n ) { foreach my $w ( @words ) { print " I see '$a[$i]{$w}'\n"; } }