develooper Front page | | Postings from October 2005

Re: PHP Template Global Variables

Thread Previous | Thread Next
George Schlossnagle
October 26, 2005 20:38
Re: PHP Template Global Variables
Message ID:
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.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About