Welcome to WebmasterWorld Guest from 18.104.22.168
Google has an API you can access w/ scripts (limited to 1k searches per day).
I have scripted queries to AltaVista by building the query into the URL & retrieving the results w/ fopen & then using Grep to parse out the hits of intererst.
I hope this helps,
Basically, you use LWP to pull the SERP of your choice, then parse the returned content to pull out the info you need (usually done with regular expressions, but there are also several HTML parsing modules [search.cpan.org] that might fit the bill)