my $mech = WWW::Mechanize->new(); $mech->get( "http://somesite.com" ); my @links = $mech->links; for my $link ( $mech->links ) { # do whatever }