perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luiz Fernando <l...@engenhosolucoes.com.br>
Subject Re: sharing data across SSI's (Executes)
Date Thu, 28 Aug 2003 20:54:58 GMT
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


Mime
View raw message