http://www.perlmonks.org?node_id=1233669


in reply to Re: How to match last character of string, even if it happens to be a newline?
in thread How to match last character of string, even if it happens to be a newline?

Mac or Windows newlines seldom cause a problem. I think of \n as a perl newline. Perl strings always use it. Translation between it and your OS's representation is done by an I/O "layer". (In Unix, the "translation" does not actually change anything.) The only exception is when we change I/O behavior by specifying non-standard layers or binmode on input.
Bill