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