use File::Find; my @dirlist = ('.', '.', 'nonexistant'); foreach my $dir (@dirlist){ eval { find( \&wanted, $dir ) }; # Does NOT work when passing a reference to foo to the find module # eval { bar() }; # DOES work when just calling a subroutine directly if( $@ ){ print "$dir had error: ".$@; } else { print "processed $dir\n"; } } sub wanted{ die "haha!"; } sub bar{ die "haha!"; } #### . had error: haha! at a.pl line 18. . had error: haha! at a.pl line 18. processed nonexistant