my $agent = WWW::Mechanize->new(); my $link = $agent->find_link( text => "some text", url_regex => qr/somelink\.com/ );