in reply to Stopping File::Find::Rule
Or use File::Next or File::Find::Object which are iterators that you can stop whenever you like.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/; }
|
|---|