Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: No. files in folder

by broquaint (Abbot)
on Jun 23, 2005 at 10:44 UTC ( #469354=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    opendir my $d, $dir;
    
  2. or download this
    my @f = sort { -M $b <=> -M $a } readdir $d;
    
  3. or download this
    my @file_list =  sort { -M $b <=> -M $a }
                     grep -f, readdir $dir_handle;
    
  4. or download this
    unlink @f[-0,1] if @f > 20;
    
  5. or download this
    use File::Spec 'catfile';
    
    unlink map catfile($dir, $_), @f[0,1]
      if @file_list > 20;
    
  6. or download this
    use File::Spec 'catfile';
    
    ...
    
    unlink map catfile($dir, $_), @f[0,1]
      if @file_list > 20;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2021-04-15 11:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?