From: John Morrice Date: 2010-12-08T07:32:11+09:00 Subject: Re: Using something like 'load' on IO Stream ? > Tony Arcieri wrote > > eval > > I would prefer another solution. > Lucas eval is going to be the least computationally expensive, most portable, most reliable, most obvious and easiest way to do this. But it isn't the only way! Given: cmd = "\"puts 'hello world'\"" You could: system "ruby -e #{cmd}" or: system "echo #{cmd} | ruby" Or if you were to do this: f = File.open "cmd.rb", "w" f.write "puts 'hello world!'" f.close You could do: system "ruby cmd.rb" Or even better: load "cmd.rb" You might think I'm crazy but sometimes I store all my ruby programs in text files! Johnny