in reply to Hide my ageing work
oshalla and eight-one gave good descriptions of the grep block
The code almost works. Here are a couple of mods to make things work
Here is the modified code
#! /usr/local/bin/perl use strict; use warnings; use diagnostics; die unless chdir "/path/directory"; die unless opendir DIR, '.'; foreach my $file (grep {-f && (14 < -M)} readdir DIR) { # print $file,"\n"; rename $file, ".$file"; # system("mv", $file, ".$file"); } closedir DIR;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hide my ageing work
by blowupp (Novice) on Oct 26, 2008 at 08:59 UTC |