#!C:/perl/bin/perl.exe; use strict; use warnings; use Cwd; # delete .xcp files older than 10 days #Identify my current directory and record it to $cdir my $cdir = getdcwd(); #create an array of all files with an exntesion of .xcp my @files = glob("*.xcp"); foreach my $file (@files) { # for each element of the array delete if mod date is greater than 10 days unlink "$cdir\\$file" if -M $file > 10; }