is a bad idea. It's much slower than the original.push (@G1_out, $input) if grep($_ eq $prefix, @Group1);
The hash solutions offered by davorg or tommyw are good except if the possibility exists that the groups are not disjoint. The example given did not overlap, but he did not explicitly say it was impossible.
In reply to Re: Re: Efficient Grouping
by Thelonius
in thread Efficient Grouping
by meetraz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |