Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: List directory(s)

by mwah (Hermit)
on May 23, 2008 at 07:30 UTC ( [id://688096]=note: print w/replies, xml ) Need Help??


in reply to List directory(s)

What do you *really* want to do? What's the purpose? Maybe there's a better version than the simplistic approach:

... my $filename = '/usr/local/bin/perl'; # get tree parts my @parts = $filename =~ m{ [^/]+ (?=/) }xg; # build tree for my $p (0 .. $#parts) { printf "%d. /%s/\n", 1+$p, join('/', @parts[0..$p]) } ...

Regards

mwa

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found