Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: No. files in folder

by borisz (Canon)
on Jun 23, 2005 at 10:36 UTC ( [id://469351]=note: print w/replies, xml ) Need Help??


in reply to No. files in folder

Your script also look for directories. Maybe you want to add a grep.
opendir my $d, $dir; # read dir, keep only files sort the files by modification time my @f = sort { -M $b <=> -M $a } grep { -f } readdir $d; # if we have more as 20 files remove the oldes two unlink @f[0,1] if @f > 20;
Boris

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://469351]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-18 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found