my $startCh = chr(0); my $endCh = chr(31); $text =~ s/[$startCh-$endCh]//g;