aboutsummaryrefslogtreecommitdiff
path: root/whoseip/whoseip.pl
diff options
context:
space:
mode:
Diffstat (limited to 'whoseip/whoseip.pl')
-rw-r--r--whoseip/whoseip.pl18
1 files changed, 9 insertions, 9 deletions
diff --git a/whoseip/whoseip.pl b/whoseip/whoseip.pl
index 225a159..fe41ae0 100644
--- a/whoseip/whoseip.pl
+++ b/whoseip/whoseip.pl
@@ -183,19 +183,19 @@ sub arin_fmt {
sub arin_decode {
my ($input, $ref) = @_;
- return if ($input =~ /^#/ or $input eq '');
+ return if ($input =~ /^#/ || $input eq '');
if ($input =~ /^NetRange:\s+(.+)/) {
my $r = $1;
$r =~ s/\s+//g;
my $n = range2count($r);
- if (!defined($ref->{count}) or $ref->{count} > $n) {
+ if (!defined($ref->{count}) || $ref->{count} > $n) {
$ref->{range} = $r;
$ref->{cidr} = join ',', Net::CIDR::range2cidr($r);
$ref->{count} = $n;
delete $ref->{country}
}
- } elsif ($input =~ /^Country:\s+(.+)/ and !defined($ref->{country})) {
+ } elsif ($input =~ /^Country:\s+(.+)/ && !defined($ref->{country})) {
$ref->{country} = $1;
}
}
@@ -308,7 +308,7 @@ sub ntt_decode {
my $r = $1;
$r =~ s/\s+//g;
my $c = range2count($r);
- if (!defined($ref->{count}) or $ref->{count} > $c) {
+ if (!defined($ref->{count}) || $ref->{count} > $c) {
$ref->{count} = $c;
$ref->{range} = $r;
$ref->{cidr} = join ',', Net::CIDR::range2cidr($r);
@@ -359,7 +359,7 @@ sub nic_or_kr_decode {
my $r = $1;
$r =~ s/\s+//g;
my $c = range2count($r);
- if (!defined($ref->{count}) or $ref->{count} > $c) {
+ if (!defined($ref->{count}) || $ref->{count} > $c) {
$ref->{count} = $c;
$ref->{range} = $r;
$ref->{cidr} = join ',', Net::CIDR::range2cidr($r);
@@ -493,15 +493,15 @@ sub serve {
}
my $srv = findsrv($term);
- if (defined($srv) and $srv ne 'UNKNOWN') {
+ if (defined($srv) && $srv ne 'UNKNOWN') {
my %prev;
while (%res = whois($term, $srv),
- and defined($res{referto})) {
+ && defined($res{referto})) {
%prev = %res if $res{status} = 'OK';
$srv = $res{referto};
}
%res = %prev
- if (!defined($res{country}) and defined($prev{country}));
+ if (!defined($res{country}) && defined($prev{country}));
if (!defined($res{country})) {
$res{status} = 'NO';
$res{diag} = 'IP unknown';
@@ -804,7 +804,7 @@ if (defined($fastcgi)) {
$fastcgi = $0 =~ /\.fcgi$/;
}
-if (defined($output_format) and $output_format =~ /@(.+)/) {
+if (defined($output_format) && $output_format =~ /@(.+)/) {
abend(EX_USAGE, "format $1 not defined") unless defined $fmtab{$1};
$output_format = $fmtab{$1};
}

Return to:

Send suggestions and report system problems to the System administrator.