Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: quickest way to find number of files in a directory?

by johngg (Canon)
on Mar 27, 2007 at 15:05 UTC ( [id://606767]=note: print w/replies, xml ) Need Help??


in reply to quickest way to find number of files in a directory?

You could try this. It excludes the '.' and '..' links

$ perl -le ' opendir D, q{dirname} or die $!; print scalar grep { ! m{^\.\.?$} } readdir D;' 123 $

Cheers,

JohnGG

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-25 15:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found