Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
What am I missing and/or is there a better way to do this? Again, all I need to know is if the directory is empty or not without deleting anything.$start = time(); chdir "c:/temp"; while (<*>) { $num++; last if ($num==1); # makes no difference in speed } $stop = time(); $elapsed=$stop-$start; print "elapsed = $elapsed seconds\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Quickly checking if a directory is empty
by Fletch (Bishop) on Aug 18, 2009 at 14:53 UTC | |
|
Re: Quickly checking if a directory is empty
by Your Mother (Archbishop) on Aug 18, 2009 at 15:45 UTC | |
|
Re: Quickly checking if a directory is empty
by leocharre (Priest) on Aug 18, 2009 at 15:49 UTC | |
|
Re: Quickly checking if a directory is empty
by alexm (Chaplain) on Aug 18, 2009 at 20:55 UTC |