use File::Find; my @dirlist = qw(.); 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!"; }