How to ignore the single and double dot entries in Perl's readdir?
问题 Following up from here: Perl Imgsize not working in loop? I have another question - how do I not let perl list the single and double dot entries when it reads the files in a directory? As in the linked question above, my output to the while loop ( while ($file = readdir($dh)) ) is something like this: . .. file1.jpg file2.jpg file3.jpg file4.jpg file5.jpg And this creates problems because I've also got a counter somewhere, which is counting my files. And . and .. don't count as files, so my