perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angus Lees <...@inodes.org>
Subject Re: [$ sub $] return
Date Wed, 10 Sep 2003 12:05:55 GMT
At Wed, 10 Sep 2003 10:47:02 +0300, Jaak wrote:
> I'm using Embperl [$ sub $] feature.
> Is it possible to return "all" data?
> 
> modules.epl
> ---
> [$ sub hello $]
> [- ($self, $hello) = @_; -]
> Hello <b>[+ $hello . '...' +]!</b>
> [$ endsub $]
> ---
> 
> test.html
> ---
> [- 
> $subs = Execute ({'object' => "modules.epl"});
> die $subs->hello('world');
> -]
> 
> It returns: "world...",
> but how to return "Hello <b>world...!</b>"

[$sub$]'s don't have useful return values.  you have to do something
like:

[-
 my $output;
 Execute({inputfile => 'modules.epl', sub => 'hello',
	  output => \$output});
 die $output;
-]

-- 
 - Gus

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


Mime
View raw message