in reply to Strange File read problem
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Strange File read problem
by abhishes (Friar) on Apr 09, 2003 at 19:51 UTC |