 <p>You can use the <code>unbackslash</code> function from <a href="https://metacpan.org/pod/String%3a%3aEscape">String::Escape</a> to do this:</p> <pre><code>use String::Escape qw( unbackslash ); my $str = 'Hello\r\nWorld\r\n'; print unbackslash($str); </code></pre>