The sort should also be numeric.
hash_slice => sub { my %ha; @ha{0..$#numbers} = @numbers; delete @ha{@indices}; my @output = @ha{sort {$a <=> $b} keys %ha}; join("\0", @output) eq join("\0", @expect) or die if TEST; },
Update: Although I now see Choroba has already done that in 11123952.
In reply to Re^3: Fastest way to "pick without replacement"
by swl
in thread Fastest way to "pick without replacement"
by haukex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |