in reply to further subdivision of unpack result

I'd do it something like this:

#!/usr/bin/perl -w use warnings; use strict; my $data = <<DATA; 16 character ID \x00\x01\x02\x03\x10\x11\x12\x13 DATA my $id = unpack ("A16", substr $data, 0, 16, ''); print "$id\n"; while (length $data) { my (@bytes) = unpack ('c4', substr $data, 0, 4, ''); printf "0x%02x ", $_ for @bytes; print "\n"; }

Prints:

16 character ID 0x00 0x01 0x02 0x03 0x10 0x11 0x12 0x13 0x0a
True laziness is hard work