Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: count files in a directory

by pvaldes (Chaplain)
on Oct 10, 2011 at 11:01 UTC ( #930584=note: print w/replies, xml ) Need Help??


in reply to count files in a directory

need to get the values and mail

sorry, I don't understand the question... what mail? this is only a list of files. If you use a list in a scalar context you will get the number of elements

my $dirname = "/home/oracle/test/Oracle/oradata"; opendir (my $DIR, $dirname ); my $num_of_files = () = readdir $DIR; print "Found ", ($num_of_files - 2), " files in the dir $dirname\n"; closedir $DIR;
Updated: don't add ".." and "." to the sum

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://930584]
help
Chatterbox?
[erix]: sleighting, I imagine 'Schlechten' will be a german word too - probably with same meaning as in dutch (breaking down, making useless a castle / defensive structure )
[erix]: oh... the german term is Schleifung

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2017-05-29 15:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?