my $ip = '24.56.102.10'; my %ours = ( 24.56.102.10 => 'ns1.t', ); if ( $ours{$ip} ) { print "Its there\n"; } else { print "Its not there\n"; }