Here's my code fragment:

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

I am running this on Win2k Pro Beta, if that makes a diff.

TIA

____________________
Jeremy
I didn't believe in evil until I dated it.


In reply to gethost from Net::Hostent fails strangely by jepri

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.