#!/usr/local/bin/perl -w use strict; use File::Find; sub logGeneral { print @_, "\n";} my $delim = '/'; my $padding = ' '; my $depth = 0; my $ltype = 'OL'; my $dir = $ARGV[0]; $dir ||= '.'; # sorted array of file and folder names our @files; sub proc { push @files, [ split $delim, $File::Find::name ]; } find(\&proc, $dir); # format it as a list! my $lastdepth = 0; for my $file ( @files ) { if ( scalar @$file > $lastdepth ) { # first entry in a sub-folder logGeneral $padding x $depth, "<$ltype>"; $depth++; logGeneral $padding x $depth, "