splice @a, 0, 1; # | | # | +-- length # +----- offset # #### for (0..$#a) { if ($a[$_] eq 'a') { splice @a, $_, 1; last; # exit the for loop because only want to delete # the first match } } #### @a = map { /a/ ? () : $_ } @a;