----- Original Message -----
From: "Steve Tuckner" <STUCKNER / MULTITECH.COM>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Friday, September 20, 2002 3:08 PM
Subject: RE: String interpolation at will?


> File.readlines("test.txt").each {|line| print eval('"' + line + '"')}

Well, I guess you'd have to use gsub to escape any existing quotes
first...

> will work. Even if there were a function such as String.interpolate(str)
it
> would still be dangerous because any code within the #{} blocks would be
> evaluated!

Hmm, there have been times I wished for a String.interpolate
method... couldn't be too hard to expose it. Wonder if it's
worth it?

Danger is always an issue... guess it's not so bad as long as
you have control over the data.

Even regular interpolation is potentially dangerous:

  string = "Hi, my name is #{format_hard_drive_and_return_name()}."


:)

Hal