$textvariable =~ tr/\cM//d; [download]
In reply to Re: How to remove ^M characters from a string? by Roy Johnson in thread How to remove ^M characters from a string? by Novician