On 12/10/2013 02:44 PM, dojo 4. wrote:
> a:~ $ ruby -e 'code = ARGV.shift; p Thread.new(code){|code| $SAFE = 12;
> begin; eval(code); rescue Object; $!; end }.value; p 42'   "... blech"
> #<SyntaxError: (eval):1: syntax error, unexpected tDOT3
> ... blech
>     ^>
> 42

Watch out for #eval; this never finishes:

ruby -e 'code = ARGV.shift; p Thread.new(code){|code| $SAFE = 12;
begin; eval(code); rescue Object; $!; end }.value; p 42'   'loop {}'