class String def substitute(binding=TOPLEVEL_BINDING) eval(%{"#{self}"}, binding) endendtemplate = %q{static string #{food}!}food = 'b'template.substitute(binding) food = 'p'template.substitute(binding)