perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel <embp...@7thfire.com>
Subject Re: Syntax=perl problem
Date Fri, 03 Jun 2005 00:36:07 GMT
Not having done this, I'm not too sure, but can't you just do:

my @out = qx(/usr/local/apache2/cgi-perl/warreng/header_test.pl); 

?

On Thu, Jun 02, 2005 at 05:01:15PM -0700, allen haim wrote:
> Hi,
> 
> Could someone please help with this Syntax=Perl problem?
> 
> -----------------------
> /notemplate/test3.html:
> 
> [-
> 
> $r = shift;
> 
>     Execute({
>         inputfile => '/usr/local/apache2/cgi-perl/warreng/header_test.pl',
>         syntax => 'Perl',
>         output => \$out,
> 
>         #options => 256,
>         #req_rec => $r
>     });
> -]
> 
> <p>output:
> 
> [+ $out +]
> 
> -----------------------
> /usr/local/apache2/cgi-perl/warreng/header_test.pl:
> 
> #!/usr/bin/perl
> print 'allen';
> -----------------------
> 
> When I point to http://localhost/notemplate/test3.html, I get:
> 
> output:
> 
> with nothing after it. 
> 
> If I hit reload about 5 or 6 times, sometimes I will get the following:
> 
> allenHTTP/1.1 200 OK Date: Thu, 02 Jun 2005 16:57:42 GMT Server: Embperl/2.0rc3 Apache/2.0.52
(Unix) mod_perl/1.999.21 Perl/v5.8.5 Content-Length: 72 Keep-Alive: timeout=15, max=99 Connection:
Keep-Alive Content-Type: text/html; charset=ISO-8859-1
> 
> output: allen
> 
> 
> It's as though the 'allen' is getting printed but not actually sent.
> 
> 
> Finally, I added the line:
> 
> select((select(STDOUT), $| = 1)[0]);
> 
> in header_test.pl.
> 
> Now, 'allen' is printed *before* 'output:' is printed.
> 
> What is the right way to call an arbitrary perl script and catch its output?
> 
> Thanks
> 
> Allen
> 
> 
> -- 
> 
> 
> 
> now through the seven oceans, 
> i am a star most famed;
> many leggies have I lost,
> many have I gained.
> 
> -donovan
> 
> 
> ---------------------------------------------------------------------
> 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