SyntaxFix
Write A Post
Hire A Developer
Questions
^M is carriage return. You can do this:
$str =~ s/\r//g