in reply to Net::DNS looping help

The answer is found in the POD for Net::DNS::Resolver:

Search...Returns a "Net::DNS::Packet" object, or "undef" if no answers were found. If you need to examine the response packet whether it contains any answers or not, use the send() method instead.

In other words, you need to be checking the return value of search() to know whether you got a valid Net::DNS::Packet object back, or undef, which would indicate no answers were found.

Hope this helps.


Dave

Replies are listed 'Best First'.
Re^2: Net::DNS looping help
by svankalken (Novice) on Jan 13, 2005 at 06:17 UTC
    Hey Dave, Thanks for the pointer.... I had read that about an hour ago and didn't give it much thought. however, a quick
    if ($search) { ....}
    ...seemed to fix it....

    once again, thanks heaps.