in reply to Help Dereferencing Net::Whois::IP
reslt is:use Net::Whois::IP qw(whoisip_query); use Data::Dumper; my $ip = "192.168.1.1"; my ($response,$array_of_responses) = whoisip_query($ip); print '$response is: ', Dumper( $response ); print '$array_of_responses is: ', Dumper( $array_of_responses) +;
The 'Var1 =' is just window-dressing added by Data::Dumper. The rest of the output looks like a hash, but is conatinined in {} rather than (), so it is a reference to hash. hence it is dereferenceed with ->. So to get the Tech contact's email, you'd say:$response is: $VAR1 = { 'OrgTechName' => 'Internet Corporation for Assigned Names an +d Number ', 'NameServer' => 'BLACKHOLE-2.IANA.ORG', 'Country' => 'US', 'PostalCode' => '90292-6695', 'OrgTechEmail' => 'res-ip@iana.org', 'RegDate' => '1994-03-15', 'NetHandle' => 'NET-192-168-0-0-1', 'NetName' => 'IANA-CBLK1', 'OrgTechPhone' => '+1-310-823-9358', 'City' => 'Marina del Rey', 'OrgName' => 'Internet Assigned Numbers Authority ', 'Comment' => ' ', 'Address' => '4676 Admiralty Way, Suite 330', 'OrgTechHandle' => 'IANA-ARIN', 'NetType' => 'IANA Special Use', 'CIDR' => '192.168.0.0/16 ', 'StateProv' => 'CA', 'Updated' => '2002-09-16', 'OrgID' => 'IANA', 'NetRange' => '192.168.0.0 - 192.168.255.255 ', 'Parent' => 'NET-192-0-0-0-0' }; $array_of_responses is: $VAR1 = undef;
Unfortunately, the keys in the hash erference are different depending on the registrar - using my IP address, I return a hashref where the Tech contact' email is accessed by:print "Tech contact's email is $response->{OrgTechEmail}\n";
print "Tech contact's email is $response->{TechEmail}\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Help Dereferencing Net::Whois::IP
by Dru (Hermit) on Jun 20, 2003 at 12:59 UTC |