#!/usr/bin/perl -w use strict; use warnings; my $dir = "/home/march05/msc0516/public_html/Blast/updated/"; chdir $dir; opendir(DIR,"$dir") or die "Could not open $dir:$!"; while (my $file=readdir(DIR)) { my $age= -M $file; unlink $file if int($age) > 1; } closedir(DIR);