use Modern::Perl; use Data::Dump qw /dump/; my @array; for my $count (1 .. 4) { my %hash; $hash {first} = $count . ' first'; $hash {second} = $count . ' second'; push @array, \%hash; } say dump(\@array);