my $max_days = 30; for my $file ( glob("*.*") ) { if ( -M $file > $max_days ) { print "$file is older than $max_days days.\n"; } }