Your inherited code could also be made a lot simpler if you used existing Perl modules such as DateTime for all the date manipulations and File::Find to deal with finding and manipulating files. The investment in learning time will surely pay off...