http://www.perlmonks.org?node_id=1041032


in reply to How to convert octal non printable chars in a string?

See the discussion at How can I safely unescape a string., revealed to me by Brother Google. Short answer:
$string =~ s/\\([0-7]+)/chr oct $1/eg;
See oct; chr; Search and replace in perlretut (search for s///e); and g in perlre for details.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.