From: Brian Candler Date: 2011-02-24T18:32:08+09:00 Subject: Re: Show text from text file in cgi script I see. Well, if it has to be CGI, you can still use erb templates like this: #!/usr/bin/ruby -w require "erb" template = ERB.new(< <%= title %>
<%= content %>
HTML title = "Oliver Twist" content = File.read("oliver_twist.txt") puts template.result(binding) # Kernel#binding is some magic which gives the template # access to your local variables -- Posted via http://www.ruby-forum.com/.