i need to remove files that are more than 30 days old. I know the foreach loop part but my if statement is not working. See below. #!/usr/bin/perl use File::stat; use File::Find; $dirname="/opt/ilbackup/status"; opendir(DIR, $dirname) or die "can't opendir $dirname: $!"; while ( defined ( $filename = readdir(DIR))) { unlink $filename if -f $filename and -M $filename > 31 ; }; closedir(DIR); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]