Errto has asked for the wisdom of the Perl Monks concerning the following question:
I'm running ActivePerl 5.8.6 on WinXP and notice the following odd behavior. If I run the following program:
And redirect the output as follows:use CGI; print "foo\n"; print "bar\n";
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.perl test.pl > test.txt
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'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: strange newline behavior in Win32 with CGI.pm and STDOUT
by ikegami (Patriarch) on Dec 06, 2005 at 01:36 UTC | |
by Errto (Vicar) on Dec 06, 2005 at 02:54 UTC | |
by crashtest (Curate) on Dec 06, 2005 at 23:53 UTC | |
by esskar (Deacon) on Dec 06, 2005 at 03:10 UTC | |
|
Re: strange newline behavior in Win32 with CGI.pm and STDOUT
by GrandFather (Saint) on Dec 06, 2005 at 01:32 UTC | |
by Errto (Vicar) on Dec 06, 2005 at 01:39 UTC | |
|
Re: strange newline behavior in Win32 with CGI.pm and STDOUT
by EvanCarroll (Chaplain) on Dec 06, 2005 at 01:28 UTC | |
by Errto (Vicar) on Dec 06, 2005 at 01:37 UTC |