in reply to Handling User Input
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
|
|---|