I followed your advice. I have narrowed my problem down to the comparison part of my code here:
foreach (@contentsOfDataBase){
chomp ($_);
print "$_";
@inDirectoryNotInDataBase = grep {!"$_"} @contentsOfDirectory;
print "@inDirectoryNotInDataBase", "\n";
}
foreach (@copyOfContentsOfDirectory){
print "$_";
@pdfNoMatchingDirectory = grep (!$_, @contentsOfDataBase);
print "@pdfNoMatchingDirectory", "\n";
}
They're nearly identical so it is the same problem in both. I changed the structure of the grep function to see if that would fix it. It didn't. The problem specifically lies in the grep line itself. This is how I understand that block to work.
foreach (@contentsOfDataBase){
chomp ($_);
print "$_";
@inDirectoryNotInDataBase = grep {!"$_"} @contentsOfDirectory;
print "@inDirectoryNotInDataBase", "\n";
}
foreach (@copyOfContentsOfDirectory){
print "$_";
@pdfNoMatchingDirectory = grep (!$_, @contentsOfDataBase);#for curre
+nt element in @copyOfContentsOfDirectory find all elements of @conten
+tsOfDataBase that are not a match
print "@pdfNoMatchingDirectory", "\n";
}
|