Alexandre Mutel wrote: > Brian Candler wrote: >> def foo; end >> src = "foo\nfoo\nbar" >> src.each_with_index do |line,i| >> eval "#{line} {\n}", binding, "DSL", i+1 >> end >> >> # Result: >> DSL:3: undefined method `bar' for main:Object (NoMethodError) > > Wooo, thanks Brian! Woop, i was to fast. In fact, i need an eval on the whole file, because my dsl language allow ruby code to be used (and so definition of methods... etc.) -- Posted via http://www.ruby-forum.com/.