Leser: 24
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use File::Spec::Functions qw( catdir ); my @basedirs = qw( d1 e1 ); my @subdirs = qw( aaa aaa/xxx ); BASEDIR: for my $base ( @basedirs ) { SUBDIR: for my $sub ( @subdirs ) { my $dir = catdir( $base, $sub ); if ( !-d $dir ) { warn "$dir is missing! Please create it!\n"; #next BASEDIR; } } }
1
2
3
4
5
6
7
8
9
my @dirs =
grep {
not -d $_ . '/aaa'
or
not -d $_ . '/aaa/xxx'
}
('d1', 'e1');
print "Fehlerhafte Verzeichnisse:\n";
print "$_\n" for @dirs;
1
2
3
opendir(DH, $<pfadzurerstenVerzeichnisebene>);
my @basedirs = readdir(DH);
closedir(DH);