我在用
Server version: Apache/1.3.34 (Debian)
mod_perl - 1.29
#!/usr/bin/perl5
package main;
use strict 'vars';
{
# Our mighty holy legacy code love to print out message in the middle of operation. Shihh....
# Let's quietly redirect those message to /dev/null.
my $nullfh = Apache::gensym( );
open $nullfh, '>/dev/null' or warn "Can't open /dev/null: $!";
local *STDOUT = $nullfh;
print "BYE BYE WORLD"; # Shouldn't show in webpage.
close $nullfh;
}
print "X BEGIN HELLO WORLD"; # Should show in webpage.
我意识到它并不是一直都在工作。例如,我刷新页面 10 次。x 次它会打印出“X BEGIN HELLO WORLD”。(10-x)时间它什么也没打印出来。
我找不到任何理由为什么它会这样。我可以知道你们中的任何人都遇到过和我类似的问题吗?