From: James Edward Gray II Date: 2007-04-16T12:18:12+09:00 Subject: Re: translate Perl diamond operator to Ruby On Apr 15, 2007, at 5:07 PM, Chad Perrin wrote: > On Mon, Apr 16, 2007 at 05:27:24AM +0900, Benjohn Barnes wrote: >> >> What _is_ ARGF? I've printed it's class, but apparently it is: >> >>> irb(main):003:0> ARGF.class >>> => Object >> >> ... an Object. >> > > Now that I know ARGF exists . . . > > http://www.danvk.org/wp/?m=200701 reports the following: > > ARGF is a great crutch for Perl programmers who miss typing while > (<>) > {...}. It opens each input file left in ARGV and yields each > line. If > there�s no input files left, it reads STDIN and yields each line it > gets there. Many, many programs do their work in an ARGF loop. I don't much care for that description. ARGF simplifies the implementation of some very common behavior for command-line programs. I don't feel it exists merely as a crutch for Perl programmers. James Edward Gray II