in reply to Stopping File::Find::Rule

File::Find::Rule is a wrapper around File::Find. Why not just use File::Find::find directly? E.g. (incomplete and untested):
use File::Find qw(find); my @files; my $result = eval { find(sub { return unless -d; push @files, $File::Find::name; die "FILE_FIND_DONE\n" if $all_done }, $dir); 1; }; unless ($result) { die $@ if $@ !~ /^FILE_FIND_DONE/; }
Or use File::Next or File::Find::Object which are iterators that you can stop whenever you like.