Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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
Replies are listed 'Best First'.
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 scrutinizing the Monastery: (7)
As of 2015-09-05 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred temperature scale is:










    Results (152 votes), past polls