I'm betting you have carriage returns and not newlines at the end of each line. Try this:
open FILE, "Sample.java" or die "Cannot open file: $!\n"; while (<FILE>) { s/\r/\\r/g; print "$_\n"; } close FILE;
In reply to Re: Strange File read problem
by chromatic
in thread Strange File read problem
by abhishes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |