use strict; use warnings; use File::Find; my $base = '/my/working/directory'; finddepth(\&no_old_dir_please, $base); sub no_old_dir_please { return if ((-M $_) <= 30); # how to quit finddepth on this condition? }