in reply to Builing a Recursive Directory Listing

You could use the CPAN CORE modules File::Find, File::Spec::Functions, etc., to traverse the directory and capture the path and filenames. With a script somewhat like below...

use strict; use warnings; use Data::Dumper; use File::Find; use File::Spec::Functions qw/ splitdir /; my %files; find ( { wanted => \&process }, "P:/vb.XpVisualStyle" ); print Dumper(\%files); sub process { # $File::Find::dir = /some/path/ # $_ = foo.ext # $File::Find::name = /some/path/foo.ext return if -d; # ignore directories, we are only interested in file +s my $fname = $_; my @dirs = splitdir($File::Find::dir); # build hash table or HTML output here # .... # build hash table %files->{path}{path} = [@filelist] my $src = "push \@{\$files{'" . join("'}{'", @dirs) . "'}}, '$fname' +"; eval "$src"; }
And the resultant hash table is quite easy to convert into HTML ... you may have to tweak a bit.
$VAR1 = { 'P:' => { 'vb.XpVisualStyle' => [ 'makeres.bat', 'xp_manifest.rc', 'xp_manifest.res', 'xp_manifest.xml', 'xp_visual.exe.manifest', 'xp_visual.txt' ] } };
Update: changed CPAN to CORE for technical correctness.