Andrea Fazzi wrote:
> Phrogz wrote:
> It works, please test it. In fact, If you don't pass explicity the
> binding argument, then the TOPLEVEL_BINDING is passed by default.

Hrm, I did test it before I posted, albeit not exactly the code you
pasted. Here's what I tested:

  template = "Hello <%=name%>"
  name = "Andrea"

  require 'erb'
  puts ERB.new( template ).result
  #=> NameError: undefined local variable or method `name' for
main:Object

  puts ERB.new( template ).result( binding )
  #=> "Hello Andrea"

Am I mistaken? Is this substantively different from what you wrote, and
I'm missing something?