Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: List directory(s)

by mwah (Hermit)
on May 23, 2008 at 07:30 UTC ( #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
Node Status?
node history
Node Type: note [id://688096]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2021-04-11 01:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?