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


in reply to Recreating a binary file from hex representation

Or you could go the kloodge route and create a hex-to-character lookup:
@chars = (0..9, 'A'..'Z'); for (0..255) { $hex{$chars[int($_ / 16)].$chars[$_ % 16]} = chr($_); }
Just feed it two hex characters and it returns the regular string character.