while(1) { $date = <>; ... if (...) { print "was wrong"; next; } if (...) { print "was very wrong"; next; } if (...) { print "totally wrong"; next; } last; }