Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
welcome AnaximanderThales

I've not so much time now, but recursive directory parse is the oldest question here at PM:
see Recursive Directory print Descending a directory tree, returning a list of files as recent examples. In both I point to the tachyon's recursive.. eehm iterative solution: it is simple and you can extend it at will. You'll find the original tachyon's post with plain explanation here

The code you point to is a little obscure, indeed
my $r = \%root; my $tmp = $name; $tmp =~ s/^\Q$root_path\E//; $r = $r->{$_} ||= {} for split m|/|, $tmp; #/ $dl{$name} ||= $r;
Is something like: r is a ref to root hash. Then r is equal to the x key value of the root hash or an empty hash. this repeted for each part of the path splitted at separator. Then if dl_name is defined ok, if it is not defined take r. see Or, Or, Equals Zero, $x ||= 0

I cannot see a meaning in this..but i'm tired now.

Best wishes
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re: Using File::Find to create a hash of directory structure. by Discipulus
in thread Using File::Find to create a hash of directory structure. by AnaximanderThales

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2022-12-06 00:47 GMT
Find Nodes?
    Voting Booth?

    No recent polls found