Added handling for when an AS or IP does not exist
This commit is contained in:
parent
eefc16d360
commit
cbae4a912b
4
aslookup
4
aslookup
|
@ -21,6 +21,10 @@ sub handle_whois_output {
|
||||||
while($obj->isnt_exhausted) {
|
while($obj->isnt_exhausted) {
|
||||||
my %wresult;
|
my %wresult;
|
||||||
my @whoisdata = split /\n/, $obj->value();
|
my @whoisdata = split /\n/, $obj->value();
|
||||||
|
if($whoisdata[0] =~ /^%/) {
|
||||||
|
print "Lookup for $target failed!\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
foreach (@whoisdata) {
|
foreach (@whoisdata) {
|
||||||
my $key = $_;
|
my $key = $_;
|
||||||
$key =~ s/^([a-z\-0-9]+):.*/$1/;
|
$key =~ s/^([a-z\-0-9]+):.*/$1/;
|
||||||
|
|
Loading…
Reference in New Issue