$msg =~ s/[[:cntrl:]]+/ /sg; #(remove CR LF, etc. ORIGINAL LINE)