# this marks the current vertex $explored->{$node->{_id}}++; foreach my $link (@{$node->{_outlinks}}) { # $link isa Link, so $link->{_id} is the id of the link, # not of the vertex!! $do_search->($link->{_to}) unless ($explored->{$link->{_id}}); }