Gunnar Hjalmarsson wrote:
Shams Fantar wrote:
Here is the algorithm :
"If there is a file in this directory which is old likewise of 10
days, to delete it or else, do nothing."
Do you have ideas to say "If there is a file which is old likewise of
10 days" in perl?
opendir my $d, $dir or die $!;
my @oldfiles = grep -f "$dir/$_" && -M _ > 10, readdir $d;
if ( @oldfiles ) {
# do something
}
Thank you for this solution, but I would prefer to write it myself. ;-)
--
Shams Fantar (http://snurf.info)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/