On Thu, 6 Sep 2001, Marcelo Aimeta wrote:
> I'm working my way through sams "Teach yourself perl in 21 days" and I'm stuck.
>
> This is the code that I'm having trouble with:
>
> #!/perl/bin/
>
> $wordcount = 0;
> $line = <STDIN>;
> while ($line ne "")
> {
> chop ($line);
> @array = split(/ /, $line);
> $wordcount += @array;
> $line = <STDIN>;
> }
> print ("Total number of words : $wordcount\n");
>
> It's a simple straightforward piece of code that counts words;
> the problem is that to quit the code, you have to enter CTRL-D, end-of-file, and I
>can't get that to work.
> I'm working on a pc, win98, activeperl, and I run this in a dos-window.
Windows uses CTRL-Z to indicate end of file. Try that instead.
-- Brett
http://www.chapelperilous.net/
------------------------------------------------------------------------
Don't lose
Your head
To gain a minute
You need your head
Your brains are in it.
-- Burma Shave
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]