in reply to perl and adns

There's an incomplete attempt at a perl adns interface here.

You might just get the milage you need out of the adnslogres utility that comes with adns though. You could just pre-process the host name resolution before your perl script parses the logs. (Supposing you wanted to do more than just resolve the hostnames).