When the script can open the directory specified by $Path, each object in that directory is enumerated. The script constructs a string that ensures the object's file path won't wrap on screen and assigns that string to the $Pretty-Path variable. The script prevents wrapped file paths by calling the AbbreviatePath() subroutine, which replaces enough characters in the string with an ellipsis (...) to ensure that the string is short enough to fit on a printed line. The $PrettyPath string is then printed to STDOUT to indicate the script's progress. Knowing the progress is important when you use the script to analyze large numbers of files.
Next, DirDiff.pl checks to see whether each object is a directory. If an object is a directory, the script adds it to the @DirList array for later processing. If an object is a file, the script retrieves the file's size (unless the user includes the -l option, one of the command-line options that I'll discuss shortly) and stores the file information in the %FileList hash. If the user wants directory recursion (which the user specifies with the -s command-line option), the script enumerates each directory in the @DirList array and recursively calls Collect-FileList() for it. . . .