sub printh { tie my %x, 'Tie::IxHash', @_; # Recreate the hash. Expensive warn $_ for keys %x; } printh(%h); # Flatten the hash