http://qs1969.pair.com?node_id=381943


in reply to Re: storing hex data in a file
in thread storing hex data in a file

You probably want to take a look at pack then.
my $x = pack("C", 0x55); print $x, "\n";
works for you specific case but I don't have a good grasp of your general case to know if it will work for that.