in reply to Removing certain elements from an array

I like the hash and array slices, but I'm not thrilled with the map. Here's a version that needs a sort, which may not gain you anything, but at least it's a different approach.
my %h; @h{ 0 .. $#array }++; delete @h{@remindexes}; @array = @array[ sort { $a <=> $b } keys %h ];