in reply to Re: Winning an Intranet competition with the aid of WWW::Mechanize
in thread Winning an Intranet competition with the aid of WWW::Mechanize

Because further down in the OP, inside the while @todo is reused to recurse into the links on the page...
while (my $url = shift @todo) { print "Visiting: $url\n"; $mech->get( $url); for ($mech->links) { my $link = $_->url_abs; push @todo, $link unless exists $seen{$link}; $seen{$link}++; } ... }
Lou
  • Comment on Re^2: Winning an Intranet competition with the aid of WWW::Mechanize
  • Download Code

Replies are listed 'Best First'.
Re^3: Winning an Intranet competition with the aid of WWW::Mechanize
by merzy (Scribe) on May 19, 2005 at 01:43 UTC
    I think muba was confused by the scalar appearing where he would expect to see an array. So was I, until I went off and tested it. Works like a charm, but I doubt I'll ever use it. (Because it causes reader confusion...)

    You learn something new every day here in the monastery. :-)