#!/usr/bin/env perl use 5.014; use warnings; use Data::Dump; use Data::Dumper; my @hash_array = map { gen_hash() } 1..10; dd @hash_array; # Dumper(\@hash_array); # Generate a hash ref with some junk in it, two levels deep sub gen_hash { my $h; $h->{int rand 1000}->{int rand 1000} = int rand 1000 for 1..10; return $h; } __END__ Output: ( { 148 => { 570 => 799 }, 279 => { 679 => 288 }, 289 => { 2 => 464 }, 524 => { 501 => 746 }, 527 => { 122 => 839 }, 574 => { 924 => 173 }, 607 => { 295 => 240 }, 662 => { 163 => 277 }, 664 => { 157 => 606 }, 686 => { 32 => 425 }, }, { 232 => { 321 => 314 }, 358 => { 555 => 596 }, 365 => { 116 => 170 }, 579 => { 536 => 659 }, 693 => { 540 => 254 }, . . .