You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Jean-Christophe Boggio <em...@thefreecat.org> on 2010/05/06 03:41:08 UTC

How does [! sub() !] work ?

Hello,

I want to define a few subs used everywhere on my site. So I wrote :

lib/subs.epl:

[!
$req = shift;

sub test {
	print OUT "test";
}
!]

test.html:
[-
$subs = Execute({object => "$ENV{DOCUMENT_ROOT}/lib/subs.epl"});
$subs->test;
-]


This works fine but I can't get the values in $req from subs.epl and
I need my $req->{dbh}...

Any clue ? Thanks for your help,

-- 
Jean-Christophe Boggio                       -o)
embperl@thefreecat.org                       /\\
Independant Consultant and Developer        _\_V

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


Re: How does [! sub() !] work ?

Posted by Jean-Christophe Boggio <em...@thefreecat.org>.
Gerald Richter - ECOS a écrit :
> just use $epreq, it's a global and works everywhere

That's perfect, thanks Gerald.

-- 
Jean-Christophe Boggio                       -o)
embperl@thefreecat.org                       /\\
Independant Consultant and Developer        _\_V

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


RE: How does [! sub() !] work ?

Posted by Gerald Richter - ECOS <ge...@ecos.de>.
Hi,

just use $epreq, it's a global and works everywhere

Gerald


> -----Original Message-----
> From: Jean-Christophe Boggio [mailto:embperl@thefreecat.org]
> Sent: Thursday, May 06, 2010 3:41 AM
> To: embperl@perl.apache.org
> Subject: How does [! sub() !] work ?
> 
> Hello,
> 
> I want to define a few subs used everywhere on my site. So I wrote :
> 
> lib/subs.epl:
> 
> [!
> $req = shift;
> 
> sub test {
> 	print OUT "test";
> }
> !]
> 
> test.html:
> [-
> $subs = Execute({object => "$ENV{DOCUMENT_ROOT}/lib/subs.epl"});
> $subs->test;
> -]
> 
> 
> This works fine but I can't get the values in $req from subs.epl and
> I need my $req->{dbh}...
> 
> Any clue ? Thanks for your help,
> 
> --
> Jean-Christophe Boggio                       -o)
> embperl@thefreecat.org                       /\\
> Independant Consultant and Developer        _\_V
> 
> ---------------------------------------------------------------------
> 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