If you just print the filenames like print "$file\n", you will see all four files!
In reply to Re: count file in directory by hdb in thread count file in directory by joaase