foreach my $test (keys %Tests) { print "Test is $test\n"; # This should print them all sorted print join("\n", sort @{$Tests{$test}}); # For checking the data, shouldn't be needed in production #print "Num before sort:", $#{$Tests{$test}} + 1, "\n"; #print join("\n", @{$Tests{$test}}); #@{$Tests{$test} = sort @{$Tests{$test}}; #print "Num after sort:", $#{$Tests{$test}} + 1, "\n"; #print join("\n", @{$Tests{$test}}); }