in reply to Re: unpack - array takes too many bytes
in thread unpack - array takes too many bytes
I guess my misunderstanding was to expected the digit in C2 to limit the assignment to 2 bytes, which it clearly does not.
Actually replacing C2 by C1 in your code like so:And warns for uninitialized likely undef. I am really missing the purpose of what the digit does!?(@two[0..1], @four[0..3], $one) = unpack "C1 C4 C", $data; print "@two | @four | $one"; # 65 66 | 67 68 69 70 |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: unpack - array takes too many bytes
by Eliya (Vicar) on Apr 15, 2011 at 05:36 UTC | |
by jwkrahn (Abbot) on Apr 15, 2011 at 06:11 UTC |