From: Ilmari Heikkinen Date: 2005-04-07T01:35:29+09:00 Subject: Re: Interpolating a string loaded from a text file ke, 2005-04-06 kello 18:49, Robert Klemme kirjoitti: > "John Elrick" schrieb im Newsbeitrag > news:1112801469.561320.13590@z14g2000cwz.googlegroups.com... > > my_message = 'Hello World' > > my_template = > > File.readlines('my_template_file.txt').HOW-CAN-I-FORCE-INTERPOLATION??? > > puts my_template <== The message is Hello World > > > > > > Anyone have any ideas? Or am I missing something blatantly obvious? > > How about: > > eval "%Q{" + File.read('my_template_file.txt') + "}" > echo "}; 10.times{ puts 'do not trust external data'" > \ my_template_file.txt Cheers :)