diff --git a/bin.org b/bin.org index 78b3349..3f9da3c 100644 --- a/bin.org +++ b/bin.org @@ -186,9 +186,11 @@ my $lookup = $input; if ( $lookup =~ /\d+[.]\d+[.]\d+[.]\d+/smx ) { $lookup = ( gethostbyaddr inet_aton($lookup), AF_INET )[0]; - die "Error: Unable to reverse lookup ip $input.\n" if ( $lookup eq q{} ); } +die "Error: Unable to reverse lookup ip $input.\n" + if ( !(defined $lookup) or $lookup eq q{} ); + my $ipv4 = gethostbyname $lookup; die "Error: $lookup doesn't have any known ip addresses\n"