while(1) { $date = <>; ... if (...) { print "was wrong"; next; } if (...) { print "was very wrong"; next; } if (...) { print "totally wrong"; next; } last; }
Now almuts suggestion is a step further than this. She suggests putting this into a subroutine and use 'return($date)' instead of the 'last'. That would do exactly the same but would be even more readable
In reply to Re: Handling User Input
by jethro
in thread Handling User Input
by cheech
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |