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
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
t
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 histo
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 pai
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 be
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
> 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