in reply to Re^2: binary parsing
in thread binary parsing

Your quoting is broken. You are doing

>perl -le"print length unpack 'A', \'n';" 1

which is the same as

>perl -le"print length unpack 'A', 'S';" 1

If you fix the quoting, you get the correct result.

>perl -le"print length unpack 'A', qq{\n};" 0

pack says "When unpacking, «A» strips trailing whitespace and nulls".