# @dirs = array of child directories # $homedir = root directory where @dirs branches from # $sourcefile = name of the file we're looking for in each directory foreach my $dir (@dirs) { if (!-e "$homedir/$dir/$sourcefile") { print "file is missing: $homedir/$dir/$sourcefile\n"; } }