From: Matthew Moss Date: 2008-12-11T06:35:45+09:00 Subject: Re: P shows object values, so can u put P and value in txt? By 'ri p', it was meant that you do that on the command-line. (Actually, you'd want to type: 'ri Kernel#p') 'ri' provides documentation for Ruby classes/methods. If you run the command 'ri Kernel#p', you'll see that 'p' returns nil. So you can't use it directly to write to a file. Have you tried 'to_s'? f1.puts lines2.diff(lines1).to_s Offhand, I don't know whether that works or not (don't have diff installed at the moment). On Dec 10, 2008, at 3:26 PM, Mmcolli00 Mom wrote: > I tried putting this but it did not work. > > File.open('log.txt', 'a') do |f1| > f1.puts ri p lines2.diff(lines1) > f1.close > end > -- > Posted via http://www.ruby-forum.com/. >