my $hexcode = "52 49 46 46 f8 e9 08 00 41 ... "; for(my $i = 0; $i < length($hexcode); $i += 3) {    print OUT chr(hex(substr($hexcode, $i, 2))); } ...