Jeff Boes wrote:
We moved our webserver from a machine where mod_perl was built under Perl 5.6.1, to a server where it was built under 5.8.1. Now, Perl scripts run but produce no browser output!

For example:

------------begin code---------
#! /usr/bin/perl -w
open (TMP,">/tmp/hello.log") or die $!;
print TMP "See, I did run.\n";
open(STDOUT,'>- :stdio') or die $!;
print "Content-type: text/html

hello, world.
";
print TMP "And I'm still running.\n";
close TMP or die $!;

-----------end code------------

This code runs, and produces output in the /tmp directory. But all I get in my browser is a blank page and a "Done."

I suppose that it's only scripts that reopen STDOUT to :stdio have this problem, right? why do you reopen STDOUT? It's already tied to the client's socket when you run under mod_perl. why :stdio?


Interesting, but the command line test produces an opposite result:

/tmp> perl-5.8.1 -wle "open STDOUT, '>- :stdio' or die $!; print 1"
1
/tmp> perl-5.8.0 -wle "open STDOUT, '>- :stdio' or die $!; print 1"
1
/tmp> perl-5.6.1 -wle "open STDOUT, '>- :stdio' or die $!; print 1"
/tmp> perl-5.6.0 -wle "open STDOUT, '>- :stdio' or die $!; print 1"

so here 5.8 works, but not 5.6.

Besides 5.6 has no idea what :stdio is, dunno why open doesn't complain:

/tmp> perl-5.6.0 -wle "binmode STDOUT, ':stdio'; print 1"
Unknown discipline ':stdio' at -e line 1.
/tmp> perl-5.6.1 -wle "binmode STDOUT, ':stdio'; print 1"
Unknown discipline ':stdio' at -e line 1.
/tmp> perl-5.8.1 -wle "binmode STDOUT, ':stdio'; print 1"
Segmentation fault
/tmp> perl-5.8.0 -wle "binmode STDOUT, ':stdio'; print 1"
1
/tmp> perl-blead -wle "binmode STDOUT, ':stdio'; print 1"
Segmentation fault

Heh, segfault in 5.8.1/5.9.0-tobe, I'll report that to p5p.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Reply via email to