in reply to Re^2: Converting ASCII to Hex
in thread Converting ASCII to Hex

You are missing what merlyn is saying. Use the unpack on the original string, not on the array of ordinals.

If you run it on the ordinals, then you are converting strings that are made up of digits, so you will get back strings in the range 30..39.

Update: The following should be more than sufficient to replace the logic in the OP:

use strict; use warnings; open my $in, "<", "./infile"; my $input = do { local $/; <$in> }; open my $out, ">", "./outfile"; print $out unpack 'H*', $input;

Though presumably you aren't hardcoding filenames in real life.