From: Jacob Fugal Date: 2005-12-22T09:13:36+09:00 Subject: Re: String > Integer Conversion Problem On 12/21/05, Timothy Hunter wrote: > The Integer() method raises ArgumentError if given an empty, > non-numeric, or otherwise non-well-formed string. On 12/21/05, James Edward Gray II wrote: > if ARGV.all? { |n| n =~ /\A\d+\Z/ } > puts "Usage..." > exit > else > one, two = ARGV.map { |n| Integer(n) } > end So could we rewrite this as: begin one, two = ARGV.map{ |n| Integer(n) } rescue ArgumentError puts Usage exit end ? Jacob Fugal