Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Depth First Search through Digraph Results in Memory Leak

by Hofmator (Curate)
on Jan 09, 2004 at 09:09 UTC ( [id://320051]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $explored->{$node->{_id}}++;
    foreach my $link (@{$node->{_outlinks}}) {
       $do_search->($link->{_to}) unless ($explored->{$link->{_id}});
    }
    
  2. or download this
    $explored->{$node->{_id}}++;
    foreach my $link (@{$node->{_outlinks}}) {
       $do_search->($link->{_to}) unless ($explored->{$link->{_to}{_id}});
    # we stored the node id, not the link id in $explored   ^^^^^
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://320051]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-25 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found