Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: No. files in folder

by broquaint (Abbot)
on Jun 23, 2005 at 10:44 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://469354]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2024-03-19 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found