my $hashRef = someFuncCall(); my $keys1 = join(' ', keys %$hashRef); my $keys2 = join(' ', keys %$hashRef); print "Key order is not stable" if $keys1 ne $keys2;