Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Perl CGI Apache 2.0 print STDERR not appearing in error_log

by hmerrill (Friar)
on Sep 19, 2002 at 12:34 UTC ( #199156=perlquestion: print w/replies, xml ) Need Help??
hmerrill has asked for the wisdom of the Perl Monks concerning the following question:

This seems like a strange one to me - I've been writing Perl CGI scripts with Apache 1.3 for the last 2+ years, and I've always known
print STDERR "Some text\n";
to go to the Apache error_log.

However, I recently(2 days ago) upgrade my machine to
perl 5.8.0 Apache/2.0.40
and now I have this situation - I have a Perl CGI script that does 'print STDERR "TOP of script A\n";' at the top - this script POST's back into itself by *not* including an ACTION. The 1st time into the script, the print appears in the Apache error_log, but after the POST I *don't* see the message appear in the error_log the 2nd time. But I know it is coming back into the same script because if I remove the STDERR from that print(so that the print is then printing to STDOUT), I get the typical "bad header" message.

Anyone know what's going on here?

Any and all help is appreciated.


Replies are listed 'Best First'.
Re: Perl CGI Apache 2.0 print STDERR not appearing in error_log
by janx (Monk) on Sep 19, 2002 at 13:59 UTC
    I have seen similar behavior (getting all output on STDERR instead of STDOUT) when moving to mod_perl/apache 2.
    This was some time (talk 3-4 months at least) ago, and was somehow related to a change perlio interface in newer perls.
    I'm probably not much of a help to you, but maybe it's a pointer for you.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://199156]
Approved by talexb
[choroba]: how many event types are there?
[Corion]: Also I found that I can't conveniently weaken an array slot, which also is inconvenient, as I want my one-shots to disappear if the caller discards them
[Corion]: choroba: Currently two or three that my program handles (WWW::Mechanize:: Chrome), but there might be more that become interesting
[Corion]: But I don't expect more than 100 to be active at the same time, so I'm not really sure if there is a not-too-fancy data structure that is maintained with few lines of code where the performance is better than the linear scan ;)
[Corion]: But I should do a mock-up program so that others can see what I'm talking about ;)
[robby_dobby]: Corion: I hope you know all too well that passing around "fancy" datastructures is a recipe for disaster :-)
[robby_dobby]: As in, it's-too-fancy- that-it-will-be- messy-to-handle
[choroba]: bit vectors as keys?
[robby_dobby]: Hmm, I keep falling asleep at my desk, while maintaining an active appearance. Am I getting old?
[robby_dobby]: Every time I fall asleep, there's a small guy in the dreams, shouting "Whoo!" and it jolts me awake. :/

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2017-05-29 08:01 GMT
Find Nodes?
    Voting Booth?