sub search { my $wanted = shift; foreach my $path (@_) { print "Searching in '$path'\n"; find($wanted, $path); } } # I don't care about the File::Find ... how do you pass the block to another subroutine/method? #### sub walk_tree { my ($self, $branch_handler, $leaf_handler) = @_; if ($self->isLeaf()) { $leaf_handler->($self->{data}); } else { $branch_handler->{$self->{data}}; foreach my $child ($self->children()) { $child->walk_tree($branch_handler, $leaf_handler); } } }