#!/usr/bin/perl use 5.016; use warnings; use List::Util qw/shuffle/; my $runs = 10^3; my $range = 1553; my @letterRange = ( 'A' .. 'Z' ); my $i = 0; my (@array, @arr2, $key, $valref, $permutes); my %permutes = (); for ($i=1;$i<=$range;$i++) { # C-style, start w/"1"; "0" would give 1554 elements @array = shuffle @letterRange for 1 ..$runs; # @arr will hold the 1000th shuffle $key = "@array"; $permutes {$key } = $i; } for my $key ( keys %permutes ) { my $value = $permutes{$key}; push @arr2, "$value => $key"; } print "size of hash: " . keys( %permutes ) . ".\n"; no warnings 'numeric'; my @sorted = sort {$a <=> $b} @arr2; use warnings; for $_ (@sorted) { say $_; } #### size of hash: 1553. 1 => V Y N H D R W Q C B E F T L S I J M O U Z A G X P K 2 => W E C B M V P I Y U D K G A T Z R O N F S J L X Q H 3 => L A T Y N R C Z J O V U G Q H F B S K W I E X P M D ...