From: Logan Capaldo Date: 2006-02-08T05:57:02+09:00 Subject: Re: Grep via Ruby On Feb 7, 2006, at 2:39 PM, James Edward Gray II wrote: > On Feb 7, 2006, at 1:13 PM, Logan Capaldo wrote: > >> Minor suggestion, line is going to end in an nl anyway. I would >> use print, unless you want all that extra whitespace in the output. > > puts() adds a newline character only if the string didn't already > end in one. > > James Edward Gray II > Egads! Surely you jest! % irb irb(main):001:0> puts "Hello\n" Hello => nil irb(main):002:0> puts "Hello\n " Hello => nil You jesteth not. And to think this whole time I've been typing print when I could have been typing puts.