use Socket; # For Binary-> IP dot quad etc... use Net::Whois::IANA; # For IP -> Name # Get IP addr # Call the sub below, and print value sub Get_Whois_Name { my $ip = shift; my $Save_ = $_; # The WhoIs module messes with $_ (BUG!!) # Save current value for restore upon exit. ##print "LOOKING FOR $ip ===="; my $iana = new Net::Whois::IANA; $iana->whois_query(-ip=>$ip); my $name = $iana->descr(); if ($name =~m/not allocated/){ $name = "Country=" .$iana->country() ."+Net=" . $iana->netname(); } #Zap commas in name $name =~s/\,/ /g; $_ = $Save_; # Restore return $name; } ##########################################
In reply to Re: perl to convert text list of ip address to a name
by NetWallah
By guaranteeing freedom of expression, the First Amendment also guarntees offense.
in thread perl to convert text list of ip address to a name
by lola_marais
For:
Use:
& & < < > > [ [ ] ]