develooper Front page | perl.php.sandwich.dev | Postings from October 2005

Re: PHP Template Global Variables

Thread Previous | Thread Next
From:
George Schlossnagle
Date:
October 26, 2005 20:38
Subject:
Re: PHP Template Global Variables
Message ID:
43604B90.3000502@omniti.com
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About