G'day rrrrr,
Welcome to the monastery.
Firstly, I'd recommend using something like ls -l instead of rm -rf while you're testing: avoid accidentally deleting the wrong files.
Backticks (`...`) are interpolating quotes in Perl - you don't need the surrounding double quotes. To identify directories, use -type d in the find command. I'm not sure what \{\} \ is doing: I'd use \\; in that position.
Putting all that together, this works for me:
my $command = `find . -type d -ctime +14 -exec ls -l {} \\;`;
Unless you want to capture the output from the find command, consider using system instead of backticks.
You also might like to take a look at Perl's file test operators: -M, -A and -C.
|