in reply to Controlling depth with File::Find

For safety, you might want to change that middle line to:
$File::Find::prune = 1 if $File::Find::name =~ tr/\/// >= $depth;
Note the safer use of >=, which works even if you're already below the target. Defensive programming can save much pain.

-- Randal L. Schwartz, Perl hacker