From: ts Date: 2000-12-15T21:37:08+09:00 Subject: [ruby-talk:7307] Re: more on the template system >>>>> "J" == Joseph McDonald writes: J> The only real kicker I have left is to figure out J> a way to ignore errors where strings contain J> variables that have not been defined. The real problem, I think, it's that you are working with local variable. With your def : def output puts "I am snippet1 var is: #{var}" puts var2.inspect puts "joe" end When ruby will compile this def, "var" and "var2" will always be (in this example) a method and not a local variable (in reality for "var", this is when ruby compile the first time the string "I am snippet1 var is: #{var}"). You can define a method_missing in JotsOutput class JotsOutput def method_missing(*args) '' end end to avoid the NameError, but after var and var2 must be defined as method also if you want to re-use this same 'def output' with another values for var and var2 Guy Decoux