#!/usr/bin/perl -T use strict; use warnings; use Archive::Zip; my $zip = Archive::Zip->new("file.zip"); my $members = $zip->members(); my $firstdate; my $lastdate; # No need to fill these in with "never", because I have had dates before. ;-) foreach my $member (@members) { my $filedate = $member->lastModTime(); if (($filedate < $firstdate) || (!defined($firstdate)) { $firstdate = $filedate; } if ((!defined($lastdate) || ($filedate > $lastdate)) { $lastdate = $filedate; } } $fh->close(); # Calculate the difference between the first and last # file dates... my $datediff = $lastdate - $firstdate; # Check if the time difference between the first and last # files is more than 3 months... if ($datediff > (60 * 60 * 24 * 30 * 3)) { # You need a new file }