in reply to convert several two digit hex characters to ascii

Let's not forget that pack/unpack are another good way to do this sort of string mangling:
#!/usr/bin/perl $target = "blah0x4445434C41524520405420blah blah"; $target =~ s/0x(([0-9a-f][0-9a-f])+)/pack('H*', $1)/ie; print $target, "\n";