in reply to Re: Can this If/Else be condensed into a 1 liner with a trailing If?
in thread Can this If/Else be condensed into a 1 liner with a trailing If?

Shorter still, but (IMHO) just as readable ...

print "Numbers only please" until <STDIN> =~ /^(\d+)$/; return $1;

    --k.


  • Comment on Re: Re: Can this If/Else be condensed into a 1 liner with a trailing If?
  • Download Code