From: Mathieu Bouchard Date: 2001-01-19T09:32:35+09:00 Subject: [ruby-talk:9528] Re: reading an entire file as a string > > File.open(path) {|f| f.read(*args) } > Except because of scope you have to write > buff = nil > File.open(path) {|f| buff = f.read(*args) } > Which is a bit uglier than > buff = File.read(path) Sorry, I tried both of the following and I cannot find a difference in results. Maybe you can enlighten me? 1. buff = File.open("/etc/hosts") {|f| f.read() } 2. File.open("/etc/hosts") {|f| buff = f.read() } matju