open FILE, "Sample.java" or die "Cannot open file: $!\n"; while () { s/\r/\\r/g; print "$_\n"; } close FILE;