1. #!/usr/bin/perl -w 2. 3. use strict; 4. use File::Find; 5. 6. open( my $report, '>', 'InventoryFile.txt' ) 7. or die "open failed: $!"; 8. 9. find( 10. sub { print $report "$File::Find::dir/$_\n" }, 11. '//InstallBox/C' 12. ); 13. 14. close( $report ) or die "close failed: $!"; #### 1. #!/usr/bin/perl -w 2. 3. use strict; 4. use List::Compare; 5. 6. my $warning = <<'END_WARNING'; 7. IGNORING FILES WITH Tmp OR Temp IN PATHNAME. 8. IGNORING FILES IN THE RECYCLE BIN. 9. IGNORING ALL HISTORY FILES. 10. LOWERCASING ALL FILE AND PATHNAMES BEFORE COMPARING 11. 12. 13. END_WARNING 14. 15. open( my $diffs, '>', 'CDiffs.txt' ) 16. or die "open failed: $!"; 17. open( my $old_inv, '<', 'OldInventory.txt' ) 18. or die "open failed: $!"; 19. open( my $new_inv, '<', 'NewInventory.txt' ) 20. or die "open failed: $!"; 21. 22. my @old_inv = map { chomp; lc } <$old_inv>; 23. my @new_inv = map { chomp; lc } <$new_inv>; 24. 25. my $compare = List::Compare->new( \@old_inv, \@new_inv ); 26. 27. print $diffs $warning; 28. 29. for ( $compare->get_Lonly() ) { 30. print $diffs $_, "\n" 31. unless ( /(?:te?mp|recycler|history)/i ); 32. } 33. 34. print $diffs "\n\n", $warning; 35. 36. for ( $compare->get_Ronly() ) { 37. print $diffs $_, "\n" 38. unless ( /(?:te?mp|recycler|history)/i ); 39. } 40. 41. close( $new_inv ) or die "close failed: $!"; 42. close( $old_inv ) or die "close failed: $!"; 43. close( $diffs ) or die "close failed: $!";