in reply to Re^2: Is there a way to open a memory file with binmode :raw?
in thread Is there a way to open a memory file with binmode :raw?

Update: The accuracy of the information I linked to (perlport: Newlines) is in question. See tye's response to this node.

In Perl, \n is a logical newline. It does not necessarily represent the single ASCII character whose decimal value is 10.

Perhaps a read of "perlport: Newlines" will help clarify the situation for you.

— Ken

Replies are listed 'Best First'.
Re^4: Is there a way to open a memory file with binmode :raw? ("\n")
by tye (Sage) on Oct 11, 2015 at 07:26 UTC

    Yeah, perlport has caused more wrong conclusions than enlightenment on newlines in my experience. For example:

    In Perl, \n is a logical newline. It does not necessarily represent the single ASCII character

    In Perl, "\n" is actually always exactly one character. On an ASCII system, it is also always ASCII linefeed... except for the single case of old Macs, which took the unprecedented route of being "almost ASCII".

    "\n" is not much more a "logical" newline than "a" is a logical letter A. "a" is also always exactly one character and is also not always the ASCII lower-case letter A.

    - tye        

      Thanks for the feedback. I've updated my node.

      — Ken