ag4ve has asked for the wisdom of the Perl Monks concerning the following question:
Which gives "No match found for n 8.8.8.8.." and produces this packet:#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; use IO::Socket; my %whois_servers = ( "RIPE"=>"whois.ripe.net", "APNIC"=>"whois.apnic.net", "KRNIC"=>"whois.krnic.net", "LACNIC"=>"whois.lacnic.net", "ARIN"=>"whois.arin.net", "AFRINIC"=>"whois.afrinic.net", ); my $sock = IO::Socket::INET->new( PeerAddr=>$whois_servers{ARIN}, PeerPort=>'43', Timeout=>'60', ); $sock->print("n + 8.8.8.8.\n"); my @ret = <$sock>; @ret = grep {length($_)} map { s/\n//; $_ } @ret; print Dumper(\@ret);
Which is the same as the whois client maintained by "Report bugs to <md+whois@linux.it>." but it produces the proper results0000 6e 20 2b 20 38 2e 38 2e 38 2e 38 2e 0a n + 8.8.8.8..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IO::Socket whois
by VinsWorldcom (Prior) on Feb 26, 2014 at 14:39 UTC | |
by ag4ve (Monk) on Feb 26, 2014 at 16:27 UTC |