in reply to force user to only enter numbers
Can you show us what you have so far?
If you don't have anything yet, you might consider building a loop that reads from STDIN, and then checks the string for non-numeric characters with a regular expression. Don't forget to chomp! Once the string is in the format you want, leave the loop and process it however you want.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: force user to only enter numbers
by adroit (Initiate) on Sep 02, 2011 at 16:12 UTC |