I have a CGI script that serves up images using the File::Copy CPAN module:
use File::Copy;
.... (set appropriate content header)
binmode STDOUT;
copy $imageFile, \*STDOUT || die "Image delivery failed: $!";
This works fine under CGI but when run under mod_perl I get:
[File::Copy::copy 140] stat() on unopened filehandle STDOUT at /usr/share/perl/5.14/File/Copy.pm line 140.
I'm not sure if this is expected behaviour or if there's a bug somewhere. I'm new to mod_perl and find I am drowning in a sea of documentation at the moment. Is there any way to change my script so it runs fine under CGI or mod_perl without changes?