From: Hal Fulton Date: 2006-06-12T03:47:30+09:00 Subject: Re: gets problem - strange 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?! ARGF really. This bites me sometimes. I have difficulty remembering the details of how it works. Hal