my $finder = File::Find->new($opts, @dirs); while (my $file = $finder->next) { # do stuff }