You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by "Luiz Fernando B. Ribeiro" <li...@athome.pro.br> on 2002/04/09 15:08:15 UTC
Re[2]: Vars in @param not being undefined
Olá Gerald,
Resposta a sua mensagem de terça-feira, 9 de abril de 2002:
GR> Hi,
>>
>> The @param array should not be cleaned automatically after the
>> end of the request?
>>
GR> Normaly it should...
GR> Can you provide a small example that shows exactly what you are doing when
GR> things goes wrong?
I have a persistent object module that saves the data to disk in the
DESTROY method of the class.
I'm using EmbperlObject. In a normal page page I call:
Execute('caixa_processar_carrinho.epl', $loja, $carrinho);
This page do some calculations and use the 2 objects passed in @param.
The $carrinho object is the persistent one.
In caixa_processar_carrinho.epl:
[-
($loja, $carrinho) = @param;
# Do some calculations
# Add some parameters to $carrinho
-]
The DESTROY method of the $carrinho object was no being called and
when I changed the code to:
[-
$loja = shift @param;
$carrinho = shift @param;
-]
everything started to work fine.
I made some tests dumping the values of the $carrinho object to a debug
file and in both cases the execution of the
caixa_processar_carrinho.epl file was right. The only difference was
that in the first case in the next request the $carrinho object was
without the new data added in this page. I also inserted a debug
message in the DFESTROY method and it was not being called at all in
the first case. Only when retrieved the object from @param with
'shift' it started to work.
Sorry if this seems confuse...
Thanks and best wishes,
Luiz Fernando B. Ribeiro
Engenho Soluções para a Internet
luiz@engenhosolucoes.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Re[2]: Vars in @param not being undefined
Posted by Gerald Richter <ri...@ecos.de>.
>
> I have a persistent object module that saves the data to disk in the
> DESTROY method of the class.
>
> I'm using EmbperlObject. In a normal page page I call:
> Execute('caixa_processar_carrinho.epl', $loja, $carrinho);
>
> This page do some calculations and use the 2 objects passed in @param.
> The $carrinho object is the persistent one.
>
Ok, now I am sure I understand what you do. It seems that somewhere inside
of Embperl there is still a reference to the parameters you pass, so it will
stay and is not been cleaned up. I have to further investigate it to find
the exact place where this is happeing. I let you know as soon as I have
resolved the issue, until then use the "shift" workaround
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org