You know NetGeo has a a perl module available on thier site that will do all the work for you without having to parse thier page. The NetGeo API includes functions take arguments that are either ASN's, ip addr's, or hostnames. Some of the available functions are: getLatLon, getCountry, getRecord, etc.