#!/usr/bin/perl use strict; use www::mechanize; my $agent = WWW::Mechanize->new(); my @urls; my $regex = 'results'; my $url ='http://www.google.co.uk/search?hl=en&safe=off&q=intitle%3A%2 +2football+scores%22+inurl%3Aresults&meta=cr%3DcountryUK%7CcountryGB'; $agent->get($url); my @urls=$agent->find_all_links(text => "some text", url_regex => qr/somelink\.com/); print stdout "@urls\n";