bizactuator has asked for the wisdom of the Perl Monks concerning the following question:
my $_FirstDir = "/home/path/public_html/software"; my $_secondDir = "/home/path/public_html"; opendir (DIR, $_FirstDir) or die "Couldn't open $_FirstDir: $!\n"; my @DirList = readdir(DIR); closedir(DIR); my $_filesNotThere = ""; my $_numMissing = 0; my $_filesThere = 0; foreach my $DirFile (@DirList) { if (-e "$_secondDir/$DirFile") { $_filesThere++; } else { $_filesNotThere .= "$_secondDir/$DirFile\n"; $_numMissing++; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Opening Directory and reading all file names and directory names
by choroba (Cardinal) on Feb 17, 2019 at 17:38 UTC | |
|
Re: Opening Directory and reading all file names and directory names
by 1nickt (Canon) on Feb 18, 2019 at 03:43 UTC |