Subject: | Is setting eol to \r\n really a safe choice? |
The docs for the eol option say:
When not passed in a generating instance, records are not terminated at all, so it is probably wise to pass something you expect. A safe choice for eol on output is either $/ or \r\n.
Common values for eol are "\012" (\n or Line Feed), "\015\012" (\r\n or Carriage Return, Line Feed), and "\015" (\r or Carriage Return). The eol attribute cannot exceed 7 (ASCII) characters.
***
\r\n probably isn't a safe choice for most users, since if they're on a platform that uses \r\n line endings, perl already does automatic CRLF translation.
I'm not sure if the second paragraph should be changed, since some people may want to generate files with Windows line endings on *nix. But I wouldn't say that's common.