jepri has asked for the wisdom of the Perl Monks concerning the following question:
print "Starting DNS lookup on $ip ..."; my $h=gethost($ip); print "here?"; ###<-- This is printed $ripname{$ip}=$h->name; print "Or here?"; ### <-- This is never printed if (length($ripname{$ip})<3) {$ripname{$ip}='FAILED'}; print "done, hostname for $ip is $ripname{$ip} !\n"; ####<- +-- Neither is this
The code is in the else part of an if statement, it seems that when gethost is called, it ends the if statement. Normal program flow then resumes.
I went back to using gethostbyaddr, which is failing to resolve anything. It appears perl is not picking up my nameserver settings. Regardless, gethost should be failing politely, not shredding the rest of the block.
Summary of my perl5 (revision 5 version 6 subversion 0) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread Build: 620
TIA
____________________
Jeremy
I didn't believe in evil until I dated it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: gethost from Net::Hostent fails strangely
by Fastolfe (Vicar) on Jan 10, 2001 at 09:28 UTC | |
by jepri (Parson) on Jan 10, 2001 at 12:43 UTC | |
by Fastolfe (Vicar) on Jan 10, 2001 at 18:42 UTC |