in reply to Common Perl Pitfalls
Deleting some array elementsI'd write that as:
If only because your splice solution can be quadratic worst case, while the above is linear (assuming should_delete has a running time bounded by a constant).@array = @array[grep {!should_delete($_)} 0..$#array];
In Section
Meditations