in reply to byte by byte by byte...
You may find PerlPackTut a somewhat better introduction to pack & unpack than the bare perlfunc pod.
As a starting place for your application, this might help. This packs five bytes, hex values 0x40 - 0x44 into a string, prefixes it with a 32-bit little-endian byte count and then unpacks the whole thing and prints the length followed by the byte values interspered with '|'s.
print join'|', unpack 'V C*', pack 'V/A*', pack 'C*', 0x40, 0x41, 0x42 +, 0x43, 0x44; 5|64|65|66|67|68
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: byte by byte by byte...
by SirBones (Friar) on Jun 11, 2004 at 12:45 UTC |