Shorter still, but (IMHO) just as readable ...
print "Numbers only please" until <STDIN> =~ /^(\d+)$/; return $1;
--k.
In reply to Re: Re: Can this If/Else be condensed into a 1 liner with a trailing If?
by Kanji
in thread Can this If/Else be condensed into a 1 liner with a trailing If?
by jerrygarciuh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |