my @array = qw(0 1 2 3 4 5 6 7 8 9 ); for (my $i = 0; $i <= $#array; $i++) { #...process...process...# splice @array, $i, 1 if $array[$i] == 5; #Delete a certain array element. }