From: Erik Veenstra Date: 2006-01-25T21:28:12+09:00 Subject: Re: String#de_inspect (and not Kernel#suspicious) Okay, the block was defined in SAFE mode 0... :) In the first version, I didn't introduce Kernel#suspicious (see below). That one worked fine. Then I naively abstracted the thread thing, which didn't do what I expected. Oops... Back to version 1... Thanks. gegroet, Erik V. - http://www.erikveen.dds.nl/ ---------------------------------------------------------------- File.open("journal", "w") do |f| f.puts "[:SAFE => $SAFE]" end # back to your code class String def de_inspect Thread.new do $SAFE = 5 eval(self, Module.new.module_eval{binding}) end.value end end def journal(file) File.open(file) do |f| while (line = f.gets) yield(line.de_inspect) end end end journal("journal") do |x| p x end ----------------------------------------------------------------