foreach(@tmp) { if (conditionA) { next; } elsif (conditionB) { &do_something; } }