On Fri, 8 Dec 2000, Aleksandr Vladimirskiy wrote:

> Well I looked at the link on perl.apache.org
> (http://perl.apache.org/guide/porting.html#STDIN_STDOUT_and_STDERR_streams),
> and it still isn't working. I must be coding wrong. Please take a look
> at the code:
> 
> $r->content_type('text/html');
> 
> $r->send_http_header;
> 
> open (STDERR, ">&STDOUT");
> 
> tie *OUT, 'Apache';
> 
> $r->print("<html><body>");
> 
> $status = system("some.prog.pl", $params{'...'}, $params{'...'});
> 
> $r->print("</body></html>");
> 
> thanks very much

Hmm, first OUT filehandler was just an example, I don't understand why did
you copy it.

Second what you probably have to do is this:

some.prog.pl:
-------------
open (STDERR, ">&STDOUT") or die "Cannot dup STDOUT: $!";
...
the rest of the code
...


the main code:
--------------
$r->content_type('text/html');
$r->send_http_header;
print("<html><body>");
print `some.prog.pl foo bar`; # back ticks return the output
print("thanks very much :)");
print("</body></html>");


I didn't test it, but that's more or less that you should do...


_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  



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

Reply via email to