Ron Smith wrote: Hans Meier (John Doe) wrote: >> >>The if-else could be shortened to (untested, so >>please check): >> >>die "Bla" unless >>($userIn)=$userIn=~/^\s*((?:\d+\s*?)+)\s*$/; > > Right; a lot shorter. Why, the parentheses around > $userIn?
Context. Without the parentheses you have scalar context but with the parentheses you have list context. In scalar context the match operator returns 'true' or 'false' but in list context it returns the contents of all capturing parentheses in the pattern. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>