I began learning Perl a few years ago as a hobby. I would like to write a script that compares two directories and prints the differences. My question is, do you know any existing Perl scripts that can do this?
More Details of how this would work:
$DIR1 will contain the full path to directory 1
$DIR2 will contain the full path to directory 2
$RECURSIVE=1 compares subdirectories too
$MODE=0 Prints a quick summary of both directories. Shows you the total size of both directories and the number of files/directories they contain.
$MODE=1 compares whether the same files exist in both places.
$MODE=2 Also compares file sizes and dates and tells you which file is younger/older or larger/smaller.
$MODE=3 Compares the MD5 hash of files that appear to be same. If the MD5 hash does not match, then those files are listed along with the hash values.
$MODE=4 If the two directories contain two files with the same name, same size, then the program will compare those files byte for byte and display the difference in detail for each file. This option could generate a very long report and may take a long time.