in reply to Re: Hide my ageing work
in thread Hide my ageing work

With all the suggested weekend reading something has rubbed off & I have disturbed the Monks again to boast that I've cracked it!
Here is my perl effort; A script to rename aged files, for the Monks archives;


#! /usr/local/bin/perl
use strict;
use warnings;
use File::Find;
#set the age tolerance
my $limit = 16;

#call the find subroutine
find (\&CheckFile, "/path to your directory");
#subroutine
sub CheckFile {
$File::Find::name;
my $age = -M;
#test the age
if (-f && ($age > $limit)) {
print $File::Find::name;
print " is ageing at ",int($age)," days old\n";
rename ( $_, "XYZ.$_;") or die "rename failed: $!";
}
else {
print $File::Find::name;
print " is a youthful ",int($age)," days old\n";
}
}