in reply to Help needed with mechanize

I wonder what $agent is.

Otherwise,

my $mech = WWW::Mechanize->new( autocheck => 1 ); $mech->get("http://www.somesite.com/"); my %art; for my $link ($mech->find_link( url_regex => qr/\d{6}/ )) { $link->url() =~ /(\d{6,})/; $art{$1} = 1; } print keys %art;

should work.

You're trying to write a C-style loop; Perl can do better.

Replies are listed 'Best First'.
Re^2: Help needed with mechanize
by lazybowel (Acolyte) on May 09, 2007 at 21:15 UTC
    thank you for your help guys i got it to work now!!