Execution problem in ruby

how to execute a ruby program which is inside a string ?
for example
ex.rb

puts “start "
temp=”(1…10).each do |count| print count end "
puts “end”

how to execute the source code in temp(String object)

On 10 Aug 2007, at 17:51, Pokkai D. wrote:

how to execute the source code in temp(String object)

eval(temp)

Hope this helps.

Douglas F Shearer
[email protected]

On Friday 10 August 2007 09:51:55 am Pokkai D. wrote:

how to execute a ruby program which is inside a string ?
for example
ex.rb

puts “start "
temp=”(1…10).each do |count| print count end "
puts “end”

how to execute the source code in temp(String object)

eval(string), but this is always what NOT-WHAT-YOU-WANT-TO-DO.

Pokkai D. wrote:

how to execute a ruby program which is inside a string ?

eval