in reply to Re^2: hash unorderly output
in thread hash unorderly output

Or, for those who prefer their solutions already coded, use Tie::IxHash.