$_ = "hi\x0bthere\x0d\x0aline 3?\x0a line4\x0dno\x0away\r\n"; print; @lines = split /\R/; print "===\n", join( "\n===\n", @lines ), "\n===\n"; #### hi there line 3? no line4 way === hi === there === line 3? === line4 === no === way ===