Brilliant minds think alike. I had finally come to my
senses and realized that I wanted to eval the thing
as a string, so I coded something very similar:

   puts eval('"' + template + '"')

At the moment, both idioms produce the same result:
Errors on the quotation marks embedded in the HTML.

So it appears I have to change them to something else
and then change them back. But I'm on my way!

thanks much
eric

Charles Oliver Nutter wrote:
Eric Armstrong wrote:
I'm reading a file into a string like this:

  template = File.open("test.dwt").readlines.join

My hope was to interpolate the #{variables} in the
file with the values defined in the program. The
first attempt didn't work:

   puts template

Nor did the second:

   puts eval(template)

Try eval("\"#{template}\"")...this makes it eval a string with the same contents as your string, causing it to interpolate.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to