Christopher Spears <[EMAIL PROTECTED]> asked:

> Can you critique my script, please?

If the options are alway numeric, you could use numeric
comparisons instead of the match operator.
That way, you would not have to chomp() the input because
the == operator converts yout string to a number while
conveniently doing away with trailing garbage.

Also, you might want to check $blade for valid input, lest
somebody input "3 rm -rf /;" or a similar exploit.

Not that this is likely to happen with a tool that you use
only by yourself, but it doesn't hurt to be a bit paranoid,
because that mindset comes handy when you have to code
critical stuff later on.

OK, the next exercise is to redo this thing with a curses interface ;-)

HTH,
Thomas

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to