Skyler99 has asked for the wisdom of the Perl Monks concerning the following question:
opendir MYDIR, 'H:/' or die $! ; my @allfiles = grep { $_ ne '.' and $_ ne '..' } readdir MYDIR ; my @files = grep { !-d } @allfiles ; my @dirs = grep { -d } @allfiles ; print "Current directory contains " . @files . " files and " . @dirs . " directories.\n" ;
update (broquaint): added formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Find files and copying to another directory
by Joost (Canon) on Feb 14, 2003 at 17:14 UTC | |
|
Re: Find files and copying to another directory
by Hagbone (Monk) on Feb 14, 2003 at 18:04 UTC |