From: Mathieu Bouchard Date: 2001-01-20T02:13:06+09:00 Subject: [ruby-talk:9553] Re: reading an entire file as a string On Fri, 19 Jan 2001 ale@crimson.propagation.net wrote: > > |1. buff = File.open("/etc/hosts") {|f| f.read() } > > |2. File.open("/etc/hosts") {|f| buff = f.read() } > > Thechenically they are same, but appearance makes difference. > I'm sorry, I'm not following the idea of sameness here. This was simply a stupid error in my original mail. It is assumed that buff exists beforehand. I should have added buff=nil before: 1. buff = File.open("/etc/hosts") {|f| f.read() } 2. buff = nil; File.open("/etc/hosts") {|f| buff = f.read() } matju