Did you read the documentation for this module? Rather than guessing about what's happening (incidentally, your original script works just fine for me), try turning on the debugging option - just as the docs recommend. Since you're having problems, you should also specify the lookup type, as shown in the docs, instead of hoping for a reasonable default to be assigned.
#!/usr/bin/perl -w use strict; use Net::Nslookup; $Net::Nslookup::DEBUG++; $Net::Nslookup::DEBUG_NET_DNS++; print "IP (A record): " . nslookup(host => "yahoo.com", type => 'A');
Do note that most types of lookups actually return a list rather than a simple scalar. Again, the docs are pretty clear on the issue.
-- Human history becomes more and more a race between education and catastrophe. -- HG Wells
In reply to Re: Net::Nslookup help needed
by oko1
in thread Net::Nslookup help needed
by gw1500se
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |