#!/usr/bin/perl -w use strict; my $boxEnd; my $pathToDirectory; my @contentsOfDataBase; my @contentsOfDirectory; my @copyOfContentsOfDirectory; my @inDirectoryNotInDataBase; print "First Box?"; chomp (my $boxBegining = <>); print "Last Box?"; chomp ($boxEnd = <>); print "Wait a minute while I look... Lazy..."; open dataBaseContents, "+>", "\\\\SHARESERVER\\DigiOfficeShare\\PerlDev\\Database.txt" or die "Aww shit I Broke"; @contentsOfDataBase = ; while() { chomp; push(my @contentsOfDataBase, $_); } close(dataBaseContents); while ($boxEnd >= my $boxBegining, $boxBegining++) { my $pathToDirectory = "\\\\SHARESERVER\\DigiOfficeShare\\PerlDev\\Box $boxBegining"; opendir(my $currentDirectory, my $pathToDirectory) || die "You sure that exists, dummy?"; while(readdir $currentDirectory) { chomp; push(my @contentsOfDirectory, $_); } closedir $currentDirectory; } @copyOfContentsOfDirectory = @contentsOfDirectory; my %seen; $seen{$_}++ for @contentsOfDataBase; $seen{$_} && undef $_ for @contentsOfDirectory; my %seen2; $seen2{$_}++ for @copyOfContentsOfDirectory; $seen2{$_} && undef $_ for @contentsOfDataBase; @contentsOfDirectory = grep { defined } @contentsOfDirectory; @contentsOfDataBase = grep { defined } @contentsOfDataBase; print "These files have PDFs and no database entries: ", @contentsOfDirectory, "\n"; print "These files have database entries and no PDFs: ", @contentsOfDataBase, "\n"; #### ); print "Last Box?"; chomp ($boxEnd = <>); print "Wait a minute while I look... Lazy..."; open dataBaseContents, "+>", "\\\\SHARESERVER\\DigiOfficeShare\\PerlDev\\Database.txt" or die "Aww shit I Broke"; while() { chomp; push(@contentsOfDataBase, $_); } close(dataBaseContents); while ($boxEnd >= $boxBegining) { my $pathToDirectory = "\\\\SHARESERVER\\DigiOfficeShare\\PerlDev\\Box $boxBegining"; $boxBegining++; opendir(my $currentDirectory, $pathToDirectory) || die "You sure that exists, dummy?"; while(readdir $currentDirectory) { chomp; push(@contentsOfDirectory, $_); } closedir $currentDirectory; } @copyOfContentsOfDirectory = @contentsOfDirectory; my %seen; $seen{$_}++ for @contentsOfDataBase; $seen{$_} && undef $_ for @contentsOfDirectory; my %seen2; $seen2{$_}++ for @copyOfContentsOfDirectory; $seen2{$_} && undef $_ for @contentsOfDataBase; @contentsOfDirectory = grep { defined } @contentsOfDirectory; @contentsOfDataBase = grep { defined } @contentsOfDataBase; print "These files have PDFs and no database entries: ", @contentsOfDirectory, "\n"; print "These files have database entries and no PDFs: ", @contentsOfDataBase, "\n";