There's an entry about counting lines in perlfaq5, which you have surely read prior to asking.
I guess you ask because you don't want to copy&paste the code, which is a laudable attitude in terms of code reuse and maintainability.
Let me tell you that I've written File::CountLines that ships (nearly) the same code as the FAQ uses, and eases the maintenance load on the stressed programmer.
In reply to Re: no of lines in uploaded text file
by moritz
in thread no of lines in uploaded text file
by prafull
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |