in reply to Recursion and Such

It sounds like you've been bit by a closure. I notice you're defining subroutines within findDir and calling find with references to those subroutines.

Because those subroutines are named, they're defined once, and what they use for $max_depth et al is a matter of some consternation for me. I haven't played with that sort of deep magic, myself, so I can't give you a definite diagnosis, but I think your troubles are in that area.(Even though as I think about it, it seems like it should be ok.)

Try defining the subs like

my $wanted = sub { ...
and passing those variables (which are subroutine references) to find. Note that you'll need to define the subroutines before the call to find.

Caution: Contents may have been coded under pressure.