>>>>> "H" == Hidetoshi NAGAI <nagai / ai.kyutech.ac.jp> writes:

H> If wp.binding method is undefined, how do you crack it?

 You make the common error to think that #to_s return a String

svg% cat b.rb
#!/usr/bin/ruby
def foo(fp)
  wp = proc{|s| p $SAFE; fp.print(s)}
  proc{|s| $SAFE=4; wp.call(s.to_s)}
end
wp = foo(open('hoge', 'w'))

puts '========================='

$SAFE = 4
class << a = []
   def to_s
      class << a = []
         def to_s
            $stderr.puts "coucou :-)"
         end
      end
      a
   end
end

wp.call(a)
svg% 



Guy Decoux