3 ms·
Way longer than a decade. You can see it in the perlfunc man page way back in 1996[0]. Of the same vintage is `Tie::IxHash`, which retains insertion order
by darrenf 2y ago
Way longer than a decade. You can see it in the perlfunc man page way back in 1996[0].
Of the same vintage is `Tie::IxHash`, which retains insertion order
% repeat 5 perl -MTie::IxHash -E 'tie my %foo, "Tie::IxHash"; @foo{qw{ c a b }} = (1)x3; printf("%s%s%s\n",keys %foo)'
cab
cab
cab
cab
cab
[0] https://metacpan.org/release/NI-S/perl5.003_02a/view/pod/perlfunc.pod#keys-ASSOC_ARRAY https://metacpan.org/release/NI-S/perl5.003_02a/view/pod/per...
- rurban 2y agoNo, Yves added randomization per iteration as described in the parent. Before it was only dependent on the per-process seed. So the seed could be computed given enough attempts to iter a hash (eg a public JSON API)
- darrenf 2y agoBut the parent is invoking `perl` itself 5 times, rather than iterating 5 times within one process.