Welcome to the Monastery | |
PerlMonks |
Re: resolving ip's to names in a text fileby Malkavian (Friar) |
on Jul 20, 2001 at 16:17 UTC ( [id://98381]=note: print w/replies, xml ) | Need Help?? |
Another question is, do you need to resolve the IP addresses within Perl? If you're doing a log analysis, and need to resolve the addresses within that log, there are a veritable cornucopia of tools out there to achieve that. One that I use, dns-terror (now called 'fastresolve') is screamingly fast, and beats every Perl solution I've yet seen. The caveat with that, is that it loads the whole DNS cache file into memory.. I've seen it chew up most of the available memory on a logging host, and bring it to it's knees.. However, that was with millions of IP addresses in cache.. Another pre-resolver is jdresolve, which, though slower than fastresolve is extremely fast, and makes use of the ADNS Perl modules. Perhaps, downloading the source for jdresolve, and reading it, or using it as a pre-processor would help. For doing many processes on a file, I find that it's often better to use dedicated tools as filters, and pipe the data through them. In many cases, I've gained huge performace benefits from this, along with the ability to easily add more functionality by adding an extra filter. To achieve this while in a Perl script, the open function with the pipe from program output to script (open(HANDLE,"program|");) would work a treat, taking resolved data from the original file, and giving you a handle on it. HTH Malk
In Section
Seekers of Perl Wisdom
|
|