http://qs321.pair.com?node_id=964224


in reply to Common Perl Pitfalls

Deleting some array elements
I'd write that as:
@array = @array[grep {!should_delete($_)} 0..$#array];
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).