perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luiz Fernando B. Ribeiro" <l...@engenhosolucoes.com.br>
Subject Re: Problems with %udat
Date Mon, 23 Dec 2002 15:11:01 GMT
Em Fri, 20 Dec 2002 20:44:14 +0000
"Maurício Amorim " <masilva3@terra.com.br> escreveu:

> Hi mailing list,
> 
> I install apache with embperl with the following configuration:
> 
> Platform: SunOS 5.6
> 
> Apache 1.3.26
> mod_perl-1.27
> HTML-Embperl-1.3.4
> Apache-Session-1.54
> Apache-SessionX-2.00b3
> 
> I did a module called mypackage.pm and i declare a function that set
> %udat
> 
> in .epl file a did:
> 
> [- use pct::mypackage; -]
> [- pct::mypackage::createsession("user", "xxxxxx"); -]
> [# $udat{user} = "xxxxxx; #]
> [+ $udat{_session_id} +]
> 
> in mypackage.pm:
> 
> #! /usr/bin/perl
> package pct::mypackage;
> sub createsession {
>     my ($k) = shift;
>     my ($v) = shift;
>     $udat{$k} = $v;
> }
> 1;
> 
> When i run the .epl file in browser, this create an session for each
> submission.
> 
> When i use %udat directly ($udat{user} = "xxxxxx;) the session work.
> 
> Anybody can help me.

Hi,

You should use the %udat hash inside your pages I don't know exactly
about the issues of using it "globally" in another scope, they are not
available there unless you set the package your pages will run.

In my modules whenever I need %udat or %fdat I pass them by reference,
like:

do_something(\%udat, \%fdat);

I think that will solve your problem.

Regards,

Luiz Fernando B. Ribeiro
Engenho Soluções para a Internet

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message