use strict; use warnings; while () { if (/0x([[:xdigit:]]+)/) { my $hexstr = $1; my $word; while ($hexstr =~ /(..)/g) {$word .= chr hex $1} s/0x$hexstr/$word/; } print; } __DATA__ blah0x4445434C41524520405420blah blah foo zoo 75858