perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Burke <bbu...@lssi.net>
Subject Re: sharing data across SSI's (Executes)
Date Tue, 02 Sep 2003 18:26:49 GMT

Thanks for the advice.  Is there a preference to using
$req->{test} versus $udat{test} ?

thanks,
Brian

Luiz Fernando wrote:

> On Thu, 2003-08-28 at 15:17, Brian Burke wrote:
> > I have an Embperl question that hopefully someone can
> > help me solve.  Bear with me, I'll try to illustrate the
> > problem.
> >
> > I run apache mod_perl with Embperl 1.3.4.  I realize
> > this is the old version, but I don't have the time, resources,
> > or access level to do something about this.  I have code
> > in which I implement server side includes in embperl
> > documents using Execute.  example -
> >
> > [- $test = true; -]
> > <html>
> > <!-- this is index.html -->
> > [- Execute ('form.inc') -]
> > </html>
> >
> > where form.inc contains html to include for rendering a form.
> >
> > My question is, is there a way with Embperl 1.3.4 to
> > share a perl variable (have the Executed page inherit
> > the value)?  For example, in the simple index.html
> > example, above, is there a way for me to access the value
> > of $test from within form.inc?  Is there a different way to
> > accomplish this?
> >
>
> Use the req_rec object from mod_perl that is passed to all Executed
> pages as the first argument in @_.
>
> [-
> $req = shift;
> $req->{test} = 'true';
> -]
> <html>
> <!-- this is index.html -->
> [- Execute ('form.inc') -]
> </html>
>
> in form.inc do the same:
> [-
> $req = shift;
> if ($req->{test} eq 'true') {
>   ...
> }
> else {
>   ...
> }
> -]
>
> --
> Luiz Fernando Ribeiro
> Engenho Soluções S/C Ltda
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org


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


Mime
View raw message