Filin wrote:
> I have a trouble with using of output of embperl procedures. E.g.
> there is following declaration in some file: [$ sub somesub $]Some
> text[$ endsub $]
>
> If I want to catch output of somesub, I can:
> Execute({inputfile=>"file", import=>0});
> Execute({inputfile=>"file", sub=>'somesub', output=>\$str});
>
> But what if I need to use something like:
> $file=Execute({object=>"file"});
> $file->somesub();
>
> How can I catch output in this case?
> It is possible of course just to replace [$ sub somesub ... $] with
> [! sub somesub {...} !],
> but I would be VERY glad to hear that it isn't the only decision.
>

You cannot directly catch the output of a method, but you can create a
wrapper:

[!
sub wrapper
    {
    $param[0]->$param[1]() ;
    }
!]

call it via

Execute({inputfile=>"file", sub=>'wrapper', output=>\$str, param => [$file,
'somesub']});

Gerald



---------------------------------------------------------------------------
Gerald Richter            ecos electronic communication services gmbh
IT-Securitylosungen * Webapplikationen mit Apache/Perl/mod_perl/Embperl

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     [EMAIL PROTECTED]          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
---------------------------------------------------------------------------
ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
---------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to