$file = "pp.txt"; open (FH ,$file) || die ("could not openfile"); while () { s/[\012\015]+/ /g; s/\@/\\@/; print; } close (FH);