for my $i (0..$#array) { if ($array[$i] eq "joby") { splice(@array, $i, 1); last; # exit loop - only interested in the first match } }