From: Todd Benson Date: 2008-09-25T05:16:10+09:00 Subject: Re: Strange ruby problem On Wed, Sep 24, 2008 at 1:29 PM, Robert Klemme wrote: > > As others have said: arguments are the problem. "gets" tries to read from > ARGF which is basically all ARGV values interpreted as files and > concatenated as streams. You typically use this for poor man's cat: > > ruby -e 'ARGF.each {|line| puts line}' foo bar baz > > You can avoid the issue by doing > > num = ARGV.shift > num2 = ARGV.shift > puts num, num2 > line = gets > > Cheers > > robert As robert says. I ran into this just the other day. ARGV has to be clear (empty), for stdin to work for gets. (Pickaxe 2nd Ed., p. 180) Todd