Yes, you are close ..
poj#!perl use strict; use Cwd; # pwd has line ending, use this my $dir = cwd(); # protect against endless loop just in case ! my $limit = 10_000; # call with parameter start($dir); sub start { my $dir = shift; # add / to descend foreach (<$dir/*>) { die "exceeded limit" if --$limit < 0; print " $_ is file\n" if (-f $_); if (-d $_) { print "$_ is a dir\n"; start($_) } } }
In reply to Re^2: "Deep recursion" error
by poj
in thread "Deep recursion" error
by cspctec
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |