[Za-pm] Cant get correct count of files in directory :(
Anne Wainwright
anotheranne at fables.co.za
Thu Nov 6 12:56:21 PST 2008
Hi,
Stupid count!
# get a list of filenames in current directory into an array
opendir (THISDIR, ".") or die "serious brain damage: $!";
@allfiles = readdir (THISDIR);
closedir (THISDIR);
$howmany = @allfiles;
print "\tthere are $howmany files in the array\n\n";
At this point it outputs a count of 133 files in the array
I count 125 + 1 hidden @ file + 5 subdirectories + the parent /.. = 132
I am sure my trusty Midnight Commander can count the files. Am I having a blonde moment?
--
so much to do, so little time :(
More information about the Za-pm
mailing list