in reply to Re^2: while following perl hack book
in thread while following perl hack book

++ysth is correct about named vs anonymous subroutines. Another confusing issue is that the first argument to find() can be either a code reference or a hash reference. In the simpler case, where you have no special options to set, you just make the first argument a *code* reference; a reference to the "callback" sub. The sub is always named "wanted" in the documentation, but it can have any name, or be a anonymous sub.

find( \&some_subroutine, @directories_to_search, );
If you need to set a special option in find(), like 'no_chdir', then you pass a *hash* reference as the first argument. The code reference (that you would have used as the first argument in the simpler case) becomes the 'wanted' option.
find( { wanted => \&some_subroutine, other_option => 'other_option_value', # ... }, @directories_to_search, );