|Think about Loose Coupling|
flush error in modperl on system commandsby barsh (Novice)
|on Jan 20, 2012 at 22:24 UTC||Need Help??|
barsh has asked for the
wisdom of the Perl Monks concerning the following question:
I have been getting sporadic errors in my modperl2, freebsd linux environment when a system command is executed. When it fails, which is roughly 25% of the time, the user gets a 500 error and there is a error log message of the form
From the <module name> and <line> values I can see these always correspond to system commands.
In the perldoc for system I found the below paragraph: "Beginning with v5.6.0, Perl will attempt to flush all files opened for output before any operation that may do a fork, but this may not be supported on some platforms (see perlport). To be safe, you may need to set $| ($AUTOFLUSH in English) or call the autoflush() method of IO::Handle on any open handles."
So I tried adding
before every system command but to no avail.
So it appears somehow the modperl http buffer is being flushed when system is called but I can't figure out why or what to do about it.
Any wisdom would be greatly appreciated!