Not very elegant, but:
$filecount = 0; @filesindir = `ls /home/a/*.txt`; foreach $file (@filesindir) { $filecount++; } print "The number of text files in my directory is: $filecount\n";
In reply to Re: how to get total numbers of files in a directory?
by bigtiny
in thread how to get total numbers of files in a directory?
by hweefarn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |