3 ms·
Perl used to let you do this, btw, but they moved away because apparently some denial of service issues were found regarding hashmaps, and so there are security
by einhverfr 12y ago
Perl used to let you do this, btw, but they moved away because apparently some denial of service issues were found regarding hashmaps, and so there are security reasons not to. I think you can tell Perl still you don't want that security and it will behave in this way. THere are other ways to do this only on some hashes but they have something of a performance penalty.
- eCa 12y agoIIRC a Perl hash has never been in the order of key add order, but rather that two hashes, with its keys added in the same order, returned their keys in the same order, even in separate executions. Now hash key order is always "random". Tie::IxHash [1] is available on Cpan. [1] https://metacpan.org/pod/Tie::IxHash https://metacpan.org/pod/Tie::IxHash