$s = '48 65 6c 6c 6f 2c 20 77 6f 72 6c 64 21';; $s =~ tr[ ][]d; print pack 'H*', $s;; Hello, world!