if (-e 'abc' && -d _) { foreach my $entry (<*.log>) { print OUTPUT ":E: $entry5 is extra file/dir \n"; } }