"Andrei A. Voropaev" wrote:

> See the guide. Under modperl the output from system will not go to the
> user unless your perl was compiled with sfio. The reason for that I
> guess is that under modperl STDOUT is tied to a package, while system
> commands expect file descriptor. The easiest way to overcome it is to
> use `` (backtics) and capture all output into variable and then print
> it out.
>
> Andrei

The guide actually says:

    3.5.5  Output from system calls
    Output of system(), exec(), and open(PIPE,"|program") calls will not be
sent to the browser
    unless your Perl was configured with sfio.

which is fair enough, but does it explain the problem I've got?

It DOES explain why the following script prints the output of IPCONFIG in the
browser when running under Apache and doesn't when running under Apache +
mod_perl:

    $| = 1;
    print "Content-Type: text/plain\n\n";
    $status = system "D:\\WINNT\\system32\\ipconfig.exe";
    print "The system() call exited with status $status.\n";

but that isn't my problem.

How does it explain why the following works under Apache 1.3.6 + mod_perl and
not under Apache 1.3.12 + mod_perl:

    print "Content-Type: text/plain\n\n";
    $status = system "D:\\WINNT\\system32\\ipconfig.exe > D:\\Temp\\ip.txt";
    print "The system() call exited with status $status.\n";

?

I'm not trying to get the output of the system() call into the browser - I
want to re-direct it to a file - and the difference between the one which
works and the one which doesn't work is not mod_perl: it's the Apache version!

Am I also correct in thinking that configuring Perl with sfio is only an
option on Unix (which, BTW, doesn't have my problem anyway!)?

Help!


Steve Hay


Reply via email to