Re: PHP Template Global Variables

[email protected] (George Schlossnagle) Wed, 26 Oct 2005 23:37:52 -0400
Newsgroups perl.php.sandwich.dev
Message-ID <[email protected]>
David Wheeler wrote:

> On Oct 26, 2005, at 7:43 PM, George Schlossnagle wrote:
>
>> The quick hack to make this work is to do:
>>
>> $php->eval(qq/function setBric(\$key, \$var) {
>>  global \$$key;
>>  \$$key = \$var;
>> }/);
>>
>> $php->setBric(element, $elem);
>
>
> Quick for me to do now, and so I will, but not so performant, I  
> suspect. Am I right? 

Not so bad, really.  A more elegant solution might be more aesthetic, 
but I don't think there'll be a noticeable performance impact either way.