From: Paul Lutus Date: 2006-11-30T02:50:07+09:00 Subject: Re: Need a range, but not getting it. . . . Peter Bailey wrote: > Simon Strandgaard wrote: >> On 11/29/06, Peter Bailey wrote: >> [snip] >>> I get: >>> im123000-im123006 >>> >>> I want: >>> im123000..im123006 >> >> >> puts ARGV.to_s.gsub(/\-/, '..') > > Yup. That certainly works, too. And, that's really simple. And it is wrong. "ARGV.to_s" collapses an array into a single string. If you provide more than one input argument, you will see the problem. > I guess I > don't see why making "files = ARGV" throws me off so. I'm just trying to > find the right mind-set for all this. The "right" mind-set is to process the array one element at a time: ARGV.each do |arg| # do something here end -- Paul Lutus http://www.arachnoid.com