I find it unlikely it's a Perl problem. Where is STDOUT
going to? Is it redirected to a resource that has problems?
(pipe, file, socket?) What happens if you change the print
to a warn? Did you run it from the command line, or do you
only have problems with it when running from Apache?