in reply to Resolving Imbedded Variables

As others have pointed out, you need to use a hash to make this reasonable. Instead of putting your replacement values into numerous variables, just put them all in a hash, then you need a way to pull them back out by their name. The way I have done this in production since, oh, about February, is here. Prior to that was a relatively ugly method, but always using hashes. The linked-to node here shows a way to put the replacement algorithm in one function (expand_string) and the actual lookup in another (expand_variable). In that node, I use parenthesis to delimit variables, but you could change that code to use whatever you want.