in reply to How to remove ^M characters from a string?

$textvariable =~ tr/\cM//d;