John Rubinubi wrote: > > Thanks. That did it. Here's another, no doubt equally stupid question. > > On p. 16 of Programming Ruby is given > > ARGF.each {|line| print line if line =~/Ruby/ } > > which is supposed to print the inputted lines which contain "Ruby" > > The while loop example in the book runs as expected but this ARGF > one-liner doesn't seem to do anything. > > Thanks, > > John Now i know what ARGF is (after looking it up). It's an alias for $< . . . which means that it's the concatentation of the input files to your program specified on the command line (or standard input if no files are specified on command line). Your one liner does work for me. If you don't specify any files on the command line, it reads from standard input and echoes every line that you enter that contains "Ruby" in it. If you specify files on the command line, it will print only those lines from those files that contain the word "Ruby". craig