sub find { my( $callback, $subdir, $path )= @_; $path= "" if ! defined $path; $path .= "/" if "" ne $path; $path .= $subdir; chdir $subdir or die "Can't chdir($path): $!\n"; my @files= ( glob(".*"), glob("*") ); for my $file ( @files ) { next if $file eq "." or $file eq ".."; if( ! -l $file && -d _ ) { find( $callback, $file, $path ); } $callback->( $file, $path ); } chdir("..") or die "Can't chdir out of $path: $!\n"; } #### sub find { my( $subdir, $path )= @_; $path= "" if ! defined $path; $path .= "/" if "" ne $path; $path .= $subdir; chdir $subdir or die "Can't chdir($path): $!\n"; my @files= ( glob(".*"), glob("*") ); for my $file ( @files ) { next if $file eq "." or $file eq ".."; if( ! -l $file && -d _ ) { find( $file, $path ); } RETURN( $file, $path ); } chdir("..") or die "Can't chdir out of $path: $!\n"; }