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
    }

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to