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

Re: Regex and perl directories question

by mkmcconn (Chaplain)
on Nov 20, 2001 at 04:31 UTC ( [id://126431]=note: print w/replies, xml ) Need Help??


in reply to Regex and perl directories question

Something like this, I think:
#!/usr/bin/perl my @dirs; my $sth; my $gt; my $dir = '/home/vendors/test/public_html'; opendir D,$dir or die $! chdir $dir; @dirs=grep{-d} readdir D; closedir D; foreach (sort @dirs) {print "$_\n"};
Maybe, although short, grep is not the best way to do this.
(# my @dirs = grep (-d, readdir D); # would work just as well, of course).
mkmcconn

Replies are listed 'Best First'.
Re: Re: Regex and perl directories question
by bryanj21 (Initiate) on Nov 20, 2001 at 04:48 UTC
    Thanks for your help!

    bjdevil

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-26 01:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found