From: Andrew Chen Date: 2008-02-22T04:44:58+09:00 Subject: Where does instance_eval _magically_ set the variable to? Hi, I use the instance_eval to merge template file and parameter files. >cat param.txt name="John" >cat tmpl.txt my name is: <%= name %> >cat template.rb #!/usr/bin/env ruby require 'erb' instance_eval(File.read('param.txt')) puts ERB.new(File.read("tmpl.txt")).result(binding) puts name >template.rb my name is: John template.rb:7: undefined method `name' for main:Object (NoMethodError) Where is the variable "name" set to? How to access it? It must be somewhere, since it is used in the tmpl.txt file. Is there any "magic" namespace in Ruby? Thanks ~Andrew Chen