> > sub GetDirList { > > > > opendir (D_LIST, $_[0]) or die "Could not open directory $_[0]"; > > while ( defined ($vf = readdir D_LIST) ) { > > next if $gf =~ /^\.\.?$/; # skip . and .. > > if (-d "$_[0]/$vf") { > > $file_list .= "$_[0]<BR>"; > > $z="$_[0]/$vf"; > > GetDirList($z); > > } > > } > > closedir DIRECTORY_LIST;
Give this a try instead: use File::Find; use strict; use warnings; my $startdir = $ARGV[0]; my @dirlist; find( sub { return if -d and /^\.\.?$/; push @dirlist, $_ if -d; }, $startdir); my $file_list = join '<BR>', @dirlist; print $file_list; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]