in reply to How is the default "Input Record Separator" set?
$/ is supposed to be set appropriately for the OS, such as LF for UNIX type systems and CRLF for DOS/Windows type systems
$/ is "\n" on Windows and on *NIX (I believe there may have been some ancient builds on Windows that used to do this differently). On Windows, the default PerlIO layers include the :crlf layer, which converts CRLF to \n on input and back on output. The :crlf layer is disabled by binmode or the pseudolayer :raw. For more details, see Newlines in perlport.
If you need specific help with a specific issue, please post an SSCCE that reproduces the issue, and a hex dump of the input file. See also my nodes here and here for a bit more information on how to gather and post information that will be useful to us in helping you.
Update: The documentation of $/ begins with "The input record separator, newline by default.", and in regards to the term "newline", see perlglossary (though the "gets automatically translated by your C library" bit is slightly outdated) and the aforementioned perlport. Note that "Mac" generally refers to Classic Mac, since Mac OS X (Darwin) is a *NIX OS.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How is the default "Input Record Separator" set?
by ikegami (Patriarch) on Mar 15, 2021 at 21:49 UTC |