Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: How to tell if a Directory is Empty

by ciderpunx (Vicar)
on Nov 11, 2011 at 23:38 UTC ( [id://937693]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        return $count - 2;     #maybe not the best way of removing . and .
    +.
    
  2. or download this
    sub isEmpty3 {
        return undef unless -d $_[0];
    ...
        my $count = grep { ! /^\.{1,2}/ } readdir $dh; # strips out . and 
    +..
        return $count;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-24 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found