in reply to binary parsing

This is surprising
$ perl -le'print length unpack "A", "\n";' 0

But documented.

Replies are listed 'Best First'.
Re^2: binary parsing
by ambrus (Abbot) on Jan 30, 2011 at 13:30 UTC
Re^2: binary parsing
by biohisham (Priest) on Jan 30, 2011 at 03:43 UTC
    It seems that the output is different on an Win32 XP system...
    perl -le"print length unpack "A", "\n";" 1
    Could you please direct me in which side of the documentation neighborhood that this is reported ?


    Excellence is an Endeavor of Persistence. A Year-Old Monk :D .

      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".