in reply to Re: how to get total numbers of files in a directory?
in thread how to get total numbers of files in a directory?
assuming that the only purpose is to get a count of matching files.opendir(DIR, "/home/a") || die "can't open dir: $!"; my $count = grep(/\.txt$/, readdir(DIR)); closedir(DIR); print "There are $count .txt files\n";
Michael
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to get total numbers of files in a directory?
by Abigail-II (Bishop) on Dec 09, 2003 at 16:07 UTC | |
by Murcia (Monk) on Dec 10, 2003 at 13:19 UTC |