Re: Reading in a File

2004-12-27 Thread Conrad Schilbe
Doug McNutt wrote: At 22:44 -0500 12/25/04, Lola Lee wrote: Nothing happens. This lesson that I'm working on is working from the premise that people are using a Windows Perl installation. Watch out for line ends in the source file that is being counted. Perl probably doesn't care because

Re: Reading in a File

2004-12-26 Thread Marco Baroni
while (defined($line = )) This line looks good in any standard setup (e.g., using perl on the terminal in osx). What is your setup? Are you sure that the problem is not elsewhere? Regards, Marco

Re: Reading in a File

2004-12-26 Thread John Delacour
At 10:44 pm -0500 25/12/04, Lola Lee wrote: This script has you count words in a file. The line where one is supposed to read in the file being counted is like so: while (defined($line = )) However, when I type this in: perl countwords.pl history.txt Nothing happens. The line you quote simply

Re: Reading in a File

2004-12-26 Thread Lola Lee
Marco Baroni said the following on 12/26/04 4:20 AM: This line looks good in any standard setup (e.g., using perl on the terminal in osx). What is your setup? Are you sure that the problem is not elsewhere? Hmm . . . looks like the script that John Delacour provided works. So something's gotta

Re: Reading in a File

2004-12-26 Thread Doug McNutt
At 22:44 -0500 12/25/04, Lola Lee wrote: Nothing happens. This lesson that I'm working on is working from the premise that people are using a Windows Perl installation. Watch out for line ends in the source file that is being counted. Perl probably doesn't care because the return-linefeed pair

Re: Reading in a File

2004-12-26 Thread Ken Williams
On Dec 26, 2004, at 4:34 AM, John Delacour wrote: At 10:44 pm -0500 25/12/04, Lola Lee wrote: This script has you count words in a file. The line where one is supposed to read in the file being counted is like so: while (defined($line = )) However, when I type this in: perl countwords.pl

Re: Reading in a File

2004-12-26 Thread John Horner
Short answer: show us the whole script, and tell us about the file history.txt. The most likely explanation for why do something for each line of file x would do nothing is that there are no lines in file x, right? That is, it will do something three times for a three-line file, and zero

Reading in a File

2004-12-25 Thread Lola Lee
I'm taking a Perl class and and I'm working on comprehending this script in one of the lessons. This script has you count words in a file. The line where one is supposed to read in the file being counted is like so: while (defined($line = )) However, when I type this in: perl countwords.pl