Try CTRL-Z
-----Original Message-----
From: Marcelo Aimeta [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 06, 2001 2:51 PM
To: [EMAIL PROTECTED]
Subject: end of file
Hi!
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.
suggestions? Please?
/Marshmellow
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]