Urb LeJeune on Wed, 30 Oct 2002 10:54:23 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: nslookup question



If I were doing it, I would work around the problem by using Perl's
built-in 'gethostbyname' function, rather than by calling the external
'nslookup'.  Then the parsing problems would go away.

Hi Marc,

        Thanks, great idea. Here is the code if anyone is interested.

Urb

# Subroutine nslookup() ########################################################
sub nslookup {
my ($Email) = @_;
my ($UserID,$Domain) = split("\@",$Email);
my ($Name,$Alias,$Type,$Length,@Addresses) = gethostbyname($Domain);
my $IPaddress = join('.',unpack('C4',$Addresses[0]));
($IPaddress eq $ENV{SERVER_ADDR}) ? return 1 : return 0;
# ($IPaddress eq "65.89.93.16") ? return 1 : return 0; # to hardcode server address
} # End of function _nslookup() ###############################################



**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**


**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**