close doesn't work on directory handles. You need closedir .
You'll stop iterating prematurely if you have a file named 0 (zero). You need to check if the result of readdir is defined. Check if it's false isn't good enough.
Why are you using a global variable for the directory handle?
It's so easy to check opendir for errors, it's a very likely candidate for errors. Add a check!
my $Tdir_qfn = "/var/www/campbell/campbell.edu/www/content/2/"; opendir(my $Tdir_dh, $Tdir_qfn) or die("Can't read dir \"$Tdir_qfn\": $!\n"); while (defined( my $f = readdir($Tdir_dh) )) { print "<li>$f\n"; } closedir($Tdir_dh);
In reply to Re^3: readdir missing one file
by ikegami
in thread readdir missing one file
by true
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |