http://qs321.pair.com?node_id=11116446


in reply to Perl Unpack Cobol Binary File and Fields

From what I remember, BINARY (and its synonym COMP-4) would correspond to a signed integer, and 9(4) (i.e. 9999) would fit in 16 bits, so I would vote for 's', or 's>' (explicitly big endian) or 's<' (explicitly little endian). Or maybe, try the 'S' (unsigned) or 'l' (signed long) variants.