Is this a windows or *nix based system? I *nix based system, u can simply ls -l | wc -l to get a count of file (not hidden) or ls -al | wc -l (to get hidden files as well).
For windows based, u need to a script for, which I haven't tried yet.
Have you done any research or tried anything so far?
opendir DIR, 'path/to/dir' or die "$!";
my @files = grep {-f "path/to/dir/$_"} readdir DIR;
close DIR;
print "Total no. of files: ", scalar @files, "\n";
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.