[Chicago-talk] Parsing a Hex file

Jay Strauss me at heyjay.com
Fri Jan 19 12:24:49 PST 2007


Ok I'm feeling slow,

I have:

(Hex):   01 00 08 30 37 30 31 31 32 30 30

so its field 1 (first 2 bytes)
length 8, (3rd field)
value: 07011200 (i.e hex 30 37 30 31 31 32 30 30)

But I can't get the unpack correct (with the proper data types):

my ($field_num, $value) = unpack("S2, S/A*", $file_contents);

my $value is never correct.  Could someone point out my error?

Thanks
Jay


More information about the Chicago-talk mailing list