use strict; use warnings; my @array = qw /aap noot mies wim zus jet teun vuur gijs lam kees bok weide does hok duif schapen/; my $counter = -1; @array = @array[grep {$_} map {$counter++; /a/ ? undef : $counter;} @array]; { local $, = '|'; print @array; }