in reply to Re: Matching a hex value in a string...
in thread Matching a hex value in a string...

... but on Windows "\n" is the same as "\r\x0A", isn't it?

Or am I completely wrong here? (no windows perl installed, can't test it :()

Replies are listed 'Best First'.
Re^3: Matching a hex value in a string...
by ikegami (Patriarch) on Feb 27, 2008 at 12:13 UTC

    No. \n is \x0A on Windows. (And $/ is \n, since the CRLF→LF conversion occurs before the buffer is searched for the IRS.)

    >perl -e"print length qq{\n} 1 >perl -e"print qq{\n} eq qq{\x0A} ?1:0 1 >perl -e"print $/ eq qq{\x0A} ?1:0 1 >echo foo| perl -e"print length <> 4

    Maybe you're thinking of older Macs, where \n is \x0D.

    Update: Added proof.