> I know I can use the "find.pm". But, I'd like to know why the recoursive
> I did is wrong.
There are no debug print statements in your code. There are also a lot
of 'next' statements, which always make me suspicious. See comments in
chopped-up code below.
Good luck,
Dave
> == Start of code
[snip]
> @dirs = &find_dirs ($ARGV[0],$depth) ;
[snip]
> sub find_dirs {
[snip]
> my ($dir_ls) = "dir /AD" ;
[snip]
> open (DIR_LS,"$dir_ls |") ;
> while (<DIR_LS>)
> {
> next if /^\s+/ ;
# insert debug print statement here
# /me tries to imagine what chmop would do
# assume you mean chomp
> chmop;
> $d = $_ ;
# you probably mean .*? here, and possibly \s*
> $d =~ s/.*<DIR>\s+// ;
> $d =~ s/\s//g ;
# this will skip lines if there is a dot anywhere in the line
# you probably mean /^\.\.?$/
> next if ($d =~ /\.\.?/) ;
> next if ($d =~ /^Export/) ;
# does this ever print?
> print "Collecting .... $d\n" ;
> push (@dirs,$d) ;
> &find_dirs ($d,$depth) ;
> }
# debug print should go here, possibly something like print "found $#dirs\n";
> close DIR_LS ;
[snip]
> === End of code
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>