@array = qw(hi hello howdy); for (@array) { if ($_ eq 'hello') { undef $_; next; } # Process list elements } @array = grep {defined} @array; print join "\n", @array;