I should have mentioned this isn't actually a CGI script. I need CGI.pm (or really CGI::Simple but same deal) for other purposes. When I run my program STDOUT is actually redirected to a file.
Comment on Re^2: strange newline behavior in Win32 with CGI.pm and STDOUT