Phrogz wrote: > Andrea Fazzi wrote: > >> Use ERB to do templating! >> File 2: test.rb >> >> require 'erb' >> >> name = "Jack" >> File.open('test.tpl') { |file| puts ERB.new(file.read).result } >> > > The above won't quite work; you need to pass in the binding to use > local variables from the current scope. > It works, please test it. In fact, If you don't pass explicity the binding argument, then the TOPLEVEL_BINDING is passed by default. Andrea -- Andrea Fazzi @ Alca Societa' Cooperativa Servizi di Informatica Libera Lecce - Italy http://alca.le.it/