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

Maybe it's a special feature or whatsoever, but...
@array = 'scalar string'; #??? # original: my @todo = 'http://intranet';
What...?




"2b"||!"2b";$$_="the question"
Besides that, my code is untested unless stated otherwise.
One more: please review the article about regular expressions (do's and don'ts) I'm working on.

Replies are listed 'Best First'.
Re^2: Winning an Intranet competition with the aid of WWW::Mechanize
by TheStudent (Scribe) on May 18, 2005 at 00:13 UTC
    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
      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. :-)