Question by MOUSIE: How do you find out the amount of lines that a user has entered in a Perl program?
Best answer:
Answer by martinthurn
my $iCount = 0;
while (my $sLine = <>)
{
# do something with the user’s input. And then:
$iCount++;
} # while
# When you’re all done:
print “User entered $iCount lines\n”;
Add your own answer in the comments!












