Don't ask to ask, just ask | |
PerlMonks |
Re: how do i work thisby Russ (Deacon) |
on May 12, 2000 at 06:17 UTC ( [id://11230]=note: print w/replies, xml ) | Need Help?? |
Here's one way to do this:
First, we check that the input is numeric (as you started to do in your commented-out code) to prevent errors if the user enters non-numeric characters. If the input is valid, we just exit the loop. If not, check for a help request and, if not '?', print a generic error message and redo the loop. There are a million different ways to do this, and this is only one of them... Russ
In Section
Seekers of Perl Wisdom
|
|