in reply to Re: Creating a binary file problem
in thread Creating a binary file problem

Given his use of pack 'C', I imagine he wants the single byte 1B, so
print BIN pack('C', hex($hex));