Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: getting the names of directories under a directory

by larryk (Friar)
on Aug 29, 2002 at 21:18 UTC ( #193920=note: print w/ replies, xml ) Need Help??


in reply to getting the names of directories under a directory

The file test operator -d works by default on $_ so you can simply grep the glob result before storing in an array.

my @names = grep -d, glob("c:/mainDir/*"); #or even my @names = grep -d, <c:/mainDir/*>;
   larryk                                          
perl -le "s,,reverse killer,e,y,rifle,lycra,,print"


Comment on Re: getting the names of directories under a directory
Download Code
Re: Re: getting the names of directories under a directory
by DS (Acolyte) on Aug 29, 2002 at 21:46 UTC
    thanks :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2014-11-29 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (204 votes), past polls