#!perl -w use strict; my $days = 12 * 7; # twelve weeks, seven days a week. while( <*> ) { next if -d; unlink $_ or die $! if -M > $days; }