Without putting all the filenames into memory:
opendir DIR, "somedirectory" or die "opendir: $!\n"; my $count; !/\A\.\.?\z/ && $count++ while defined($_ = readdir(DIR)); closedir DIR or warn "closedir: $!\n"; print "$count\n";
(You'd need to add a -f or similar test for it to only consider plain files, or non-directories, etc.)
In reply to Re: Total Files
by wog
in thread Total Files
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |