foreach my $folder (@folders) { my $folderfullpath = $componentrootpath . "/" . $folder; print "Working with folder " . $folderfullpath . "\n" if ($debug); opendir(my $folderhandle, $folderfullpath); foreach my $element (readdir($folderhandle)) { next if ($element =~ /^\./); my $quotedfullelementpath = "\"" . $folderfullpath . "/" . $element . "\""; print "\n *** Full element path: " . $quotedfullelementpath . "\n" if ($debug); next unless (-T $fullelementpath); open (FILE, "<" . $quotedfullelementpath) or die "Can't open file $quotedfullelementpath:$!\n"; while () { binmode(FILE); my $line1 = unpack("H*", $_); if ($line1 =~ /0d/) { # File is contaminated; print $quotedfullelementpath . " - contaminated\n" if ($debug); my ($elementrootname, $elementuuid) = &nameanduuid($fullelementpath); push (@contaminateduuids, $elementuuid) unless ($contaminateduuids{$elementuuid}); $contaminateduuids{$elementuuid} = 1; last; } } close (FILE); } }