in reply to Efficient Grouping
To make the assignment one step, but this won't be a significant change when comparing to a more efficient loop. You could make the loop more efficient by making your test cases ordered by probability, and then skip to the next line without testing it again with@G1_Hash{ qw/HO KO.../ } = ();
The exists function is just to fix my prior laziness - assiging an empty list to the hash slice - which will result in the values being undefined. I don't know, but perhaps not testing for truth on the value may save a bit more...push (@G1_out, $input), next if exists $G1_Hash{$prefix}
|
|---|