From: "Marcel Molina Jr." Date: 2006-06-12T03:48:17+09:00 Subject: Re: gets problem - strange On Mon, Jun 12, 2006 at 03:44:53AM +0900, Jim Freeze wrote: > On Jun 11, 2006, at 1:36 PM, Marcel Molina Jr. wrote: > > >It works like perl in this regard, expecting the arguments on the > >command > >line to be files the lines of which you want read. > > > >% echo -e "foo\nbar" > some_file > >% echo "while l = gets; p l end" > gets.rb > >% ruby gets.rb some_file > >"foo\n" > >"bar\n" > > So, I suppose that one needs to empty out ARGV before using gets? > > Wow. Really?! You want IO#gets not Kernel#gets. STDIN.gets marcel -- Marcel Molina Jr.