I didn’t even look at all the listings, but there is no way Listing H will actually run.
# set up counter to track number of files processed $count = 0;
Minor error, since you’re not using strict you don’t need to declare your variables, but I imagine you want a newline after the comment, before $count.