From: Wes Gamble Date: 2006-03-23T05:58:42+09:00 Subject: Best way to slurp a file into a string? All, I would like to capture the entire contents of a file in to a string (a la Perl) - is this the best way to do it? File.open(@document.path, r) do |f| @lines = f.readlines html = @lines.join end so that the html variable has all of the contents of f. Is there a better/easier way? Thanks, Wes -- Posted via http://www.ruby-forum.com/.