Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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"; } } In reply to Re^2: Hide my ageing work
by blowupp
|
|