use strict; use warnings; use Fatal qw/ open close /; use WWW::Mechanize; use Carp; my $mech = WWW::Mechanize->new( autocheck => 1 ); open my $pro_list, '>>', 'profiles.out'; for my $curr_page (1..3) { $mech->get("http://indiecharts.com/indie_Music_Artists.asp?Keyword=&Page=$curr_page&butname="); my @artist_links = $mech->find_all_links(url_regex => qr/\d{9}/); print scalar @artist_links, " matching links on page $curr_page\n"; for my $artist_link (@artist_links) { print $pro_list $artist_link->text(), "\n"; } }