I'm running ActivePerl 5.8.6 on WinXP and notice the following odd behavior. If I run the following program:
use CGI;
print "foo\n";
print "bar\n";
And redirect the output as follows:
perl test.pl > test.txt
Then when I open the file in Notepad, the text appears as "foobar" but it appears correctly in Wordpad, which leads me to suggest that it's writing Unix newlines instead of DOS newlines. The weird part - removing CGI fixes it.
I'm thinking of reporting this as a bug, but I can't figure out where, and it seems like a bit of an odd problem. Any suggestions?
Note that this does not seem to affect files opened directly for writing like open my $fh, '>test.txt'