my $str = 'line1\r\nline2\r\n"; my $result = join '

', split(/\r\n/, $str);