in reply to Re^6: Dealing with files with differing line endings
in thread Dealing with files with differing line endings
when reading a line using "<:raw", Perl is looking for a LF to determine the "end of line"
It's looking for $/.
chomp() only operates on LF, not CRLF.
chomp operates on whatever $/ is set to, including if that's set to CRLF for whatever unusual reason.
When reading a Windows file on Unix, the I/O layer zaps the CR and I never see it.
Only if you explicitly specify the :crlf layer, which your code doesn't do.
The terminology does get confusing because "\n" as written in Perl on Windows sometimes means CRLF and sometimes it means only LF.
For about the millionth time: No. Maybe it's finally time to read Newlines in perlport?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^8: Dealing with files with differing line endings
by pryrt (Abbot) on Nov 15, 2021 at 22:08 UTC | |
by haukex (Archbishop) on Nov 16, 2021 at 07:17 UTC |
In Section
Seekers of Perl Wisdom