From: Michael Neumann Date: 2001-04-15T19:46:25+09:00 Subject: [ruby-talk:13686] Re: Question on gsub with a block Matt Armstrong wrote: > First, is there any better way to read a whole file into a string > variable than this: > > template = IO.readlines(@template, nil)[0] I prefer: template = File.readlines(@template).to_s But I think, in Ruby 1.8 there'll be File::read which returns a String object: template = File.read(@template) Regards, Michael