in reply to how to get total numbers of files in a directory?

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";