blowupp has asked for the wisdom of the Perl Monks concerning the following question:
my $limit = 20; find (\&CheckFile, "/Users/admin/Documents/ScriptTest/"); sub CheckFile { $File::Find::name; my $age = -M; if (-f && '$_, !~ /^\./' && ($age > $limit)) { rename ( $_, ".$_") or die "rename failed: $!"; } else { print $File::Find::name; print " is a youthfull ",int($age)," days old\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Rename old files that do not begin with a dot
by Corion (Patriarch) on Oct 27, 2008 at 19:51 UTC | |
|
Re: Rename old files that do not begin with a dot
by ikegami (Patriarch) on Oct 27, 2008 at 19:52 UTC | |
|
Re: Rename old files that do not begin with a dot
by ikegami (Patriarch) on Oct 27, 2008 at 20:34 UTC | |
by Anonymous Monk on Oct 27, 2008 at 22:31 UTC | |
|
Re: Rename old files that do not begin with a dot
by runrig (Abbot) on Oct 27, 2008 at 19:53 UTC | |
|
Re: Rename old files that do not begin with a dot
by mr_mischief (Monsignor) on Oct 27, 2008 at 20:11 UTC |