for $item (@list) { next if $item == 2 or $item == 4; ... rest of processing .. } #### my @newlist = grep { $_ != 2 and $_ != 4 } @list;