Use a global flag to say you are done:
use strict; use warnings; use File::Find; my $base = '/my/working/directory'; my $done = 0; finddepth(\&no_old_dir_please, $base); sub no_old_dir_please { $done ||= (-M $_) <= 30; $File::Find::prune = $done; }
Update: Read the docs before replying next time :)
Note, not tested
In reply to Re: How to conditionally terminate finddepth?
by GrandFather
in thread How to conditionally terminate finddepth?
by sk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |