#!/Perl/bin/perl use strict; use warnings; print "Enter the directory to map: "; chomp(my $dir = ); #$dir = (length($dir) == 3? $dir:$dir."\\"); open(LOG,"> c:/log.html") or die "$!"; print LOG qq{ Map of:}.$dir.qq{ }; print LOG qq{

Map of }.$dir.qq{


\n}; print LOG qq{\n\n}; close(LOG); ##Recursive routine to print out all the files & folders under a given root node sub mapMe { #Get the parameter my ($handle) = @_; #Open the directory passed to the subroutine opendir(SPROUT,$$handle); #read the entries my @entries = readdir(SPROUT); #Close the directory closedir(SPROUT); my @list; my @dir; my @file; foreach (2..$#entries) { next if lc($entries[$_]) eq 'thumbs.db'; if(opendir(TEST,$$handle.(length($$handle) == 3? '':"\\").$entries[$_]) and $entries[$_]) { closedir(TEST); push @dir,$$handle.(length($$handle) == 3? '':"\\").$entries[$_]; } elsif($entries[$_]) { push @file,$entries[$_]; } } push @list,sort @file; push @list,sort @dir; foreach my $item (@list) { #If its a directory and its not null if(opendir(TEST,$item)) { #Close the directory closedir(TEST); #print LOG qq{