Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^6: WWW::Mechanize problem

by herveus (Prior)
on Oct 20, 2005 at 16:56 UTC ( [id://501732]=note: print w/replies, xml ) Need Help??


in reply to Re^5: WWW::Mechanize problem
in thread WWW::Mechanize problem

Howdy!

A couple of emendations that don't change the essential meaning but do affect whether it works as presented...

my @work = fetch_jobs($starting_condition); my %seen; while ( @work ) { # Remove 1 item from our stack/queue my $job = shift @work; # Skip this job if we have already done it next if $seen{$_}++; ## $_ should probably be $job, no? # Possibly add new jobs to our stack/queue if ( more_jobs($_) ) { ## $_ should probably be $job, no? push @work, fetch_jobs($_); ## $_ should probably be $job, no? } # process job }
...because $_ isn't set or otherwise given meaning in this snippet.

while ( @work || @work < 1000 ) { # should ought to be && not || }
...otherwise the loop will never exit, as an empty @work will always be less than 1000...

yours,
Michael

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 11:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found