If you have not done so already you may want to read the Google terms of service. "You may not take the results from a Google search and reformat and display them"
One would sign up for an API Key (after reading and agreeing to the Ts & Cs):
"To access the Google Web APIs service, you must create a Google Account and obtain a license key. Your Google Account and license key entitle you to 1,000 automated queries per day."
Then take a look at Cpan results for Google , such as WWW::Search::Google and start from there perhaps.