http://www.perlmonks.org?node_id=1052269


in reply to Re^2: count file in directory
in thread count file in directory

Have you really added the line I proposed to your script? Rather than trying to find hidden files or such?