in reply to Re^6: deleting a specific element from an array
in thread deleting a specific element from an array

I think your code actually proves my point, not yours.

use Data::Dumper; my @array=('water','wine','applepie','beer','orange juice',"apple\n"); my @dels=('apple','orange'); my $dels = join '|', map quotemeta, @dels; @array = grep !/^($dels)$/, @array; print Dumper \@array; __END__ $VAR1 = [ 'water', 'wine', 'applepie', 'beer', 'orange juice' ];

It removes both "apple" and "apple\n"—even though "apple\n" was not one of the @dels. If you change the $ to \z in the regular expression, the "apple\n" comes through (and "apple" is still removed).