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); #### [ { first => "1 first", second => "1 second" }, { first => "2 first", second => "2 second" }, { first => "3 first", second => "3 second" }, { first => "4 first", second => "4 second" }, ]