我有擔任了使用文件::圖像的CGI腳本複製CPAN模塊:使用文件::複製服務了mod_perl下的圖像失敗
use File::Copy;
.... (set appropriate content header)
binmode STDOUT;
copy $imageFile, \*STDOUT || die "Image delivery failed: $!";
這工作下CGI正常,但當mod_perl下我運行得到:
[File::Copy::copy 140] stat() on unopened filehandle STDOUT at /usr/share/perl/5.14/File/Copy.pm line 140.
我不知道這是否是預期的行爲或者是否存在某處的錯誤。我是mod_perl的新手,現在我正陷入一片文檔之中。有什麼方法可以改變我的腳本,使它可以在CGI或mod_perl下正常運行嗎?