#### #### Check for expired backups #### print $backup_daily_subdir."\n"; die unless chdir "$backup_daily_subdir"; die unless opendir DIR, "."; foreach $file (grep {-f && (31 < -M)} readdir DIR) { unlink $file; } closedir DIR; print $backup_weekly_subdir."\n"; die unless chdir "$backup_weekly_subdir"; die unless opendir DR, "."; foreach $files (grep {-f && (365 < -M)} readdir DR) { unlink $files; } closedir DR; #### ~/perl/sandbox]$ ./newtime.pl Name "main::files" used only once: possible typo at ./newtime.pl line 59. Name "main::isdst" used only once: possible typo at ./newtime.pl line 16. Name "main::yday" used only once: possible typo at ./newtime.pl line 16. The file for this hour already exists! Died at ./newtime.pl line 57.