in reply to Puzzler - filtering characters

Linefeed is 10 in decimal => 12 in octal, and you can combine three of your substitutes into a single character class:

$text =~ s/[\000-\011\013-\037\177-\377]/ /g;

Or, using a POSIX character class, the much more readable

s/[^[:print:]\n]/ /g;

See perlre for a full list of the POSIX character classes