in reply to Using File::Find to create a hash of directory structure.
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 ||= 0my $r = \%root; my $tmp = $name; $tmp =~ s/^\Q$root_path\E//; $r = $r->{$_} ||= {} for split m|/|, $tmp; #/ $dl{$name} ||= $r;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using File::Find to create a hash of directory structure.
by Anonymous Monk on Dec 19, 2015 at 22:53 UTC | |
by AnaximanderThales (Novice) on Dec 21, 2015 at 21:07 UTC | |
|
Re^2: Using File::Find to create a hash of directory structure.
by AnaximanderThales (Novice) on Dec 21, 2015 at 21:06 UTC |