#!/usr/bin/perl use strict; use warnings; ### This program looks at the current directory and then makes a path to all the sub directories. ### Step 1: Create a subroutine with Variables for the program. This includes the following: ### Files, Path and Directories. ### Step 2: make the program list the files and folders of current directory. Push folders into an array ### Step 3: Print Dirs ### Step 4: Recurse if (@ARGV != 1) { print "Usage: perl $0 [PATH/][TO/]DIR\n"; exit; } my $path = $ARGV[0] ; sub list { my $path=$_[0]; #print "DEBUG - listing [$path]\n"; chomp(my @files = `ls -a $path`); my @dirs; foreach(@files) { if (-d "$path/$_" && $_ ne "." && $_ ne ".."){ push (@dirs , "$path/$_"); } } print "-------------------------------------\n"; print "Generating HTML doc for path = [$path]\n"; open(FHOUT, ">", "$path/index.html") or die "Can't open '$path/index.html':$!\n"; print FHOUT ""; print FHOUT "
" . "