use strict; use warnings; use WWW::Mechanize; my $agent = WWW::Mechanize->new(); my $regex = 'showthread'; my $username1 = 'guesthere52'; my $subject = 'official website'; my $message = 'Offical website http://supermanreturns.warnerbros.com'; my $url ='http://www.google.co.uk/search?hl=en&safe=off&q=intitle%3A%22superman+returns%22++%22you+may+post+new%22&meta='; $agent->get($url); $agent->agent_alias( 'Windows IE 6' ); my @urls = $agent->find_all_links(); foreach(@urls){$agent->follow(url_regex => qr/showthread/);} foreach my $link(@urls) { $link->url(); $agent->set_visible($username1, $subject, $message, $link->url()); $agent->click("submit"); } print $agent->response()->as_string();