Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Count number of lines in a text file

by Anonymous Monk
on Jan 23, 2013 at 08:53 UTC ( [id://1014861]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while (sysread FILE, $buffer, 4096) {
            $lines += ($buffer =~ tr/\n//);
        }
    
  2. or download this
    while (<FILE>) {
      $lines++
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1014861]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-03-28 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found