in reply to Re^2: Question of scope and syntax
in thread Question of scope and syntax
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); print "@pdfNoMatchingDirectory", "\n"; }
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Question of scope and syntax
by davido (Cardinal) on May 03, 2012 at 16:10 UTC | |
by Hellhound4 (Novice) on May 03, 2012 at 17:47 UTC |