in reply to Looking for Net::DNS use syntax

change your definition of $res from
$res = new Net::DNS::RR;
to become
$res = new Net::DNS::Resolver;
As far as I can see, the rest looks ok, I can see 216.8.86.8 as ns1.lunarmedia.net using your script with that modification

Replies are listed 'Best First'.
Re: Re: (Net::DNS question)
by c (Hermit) on Jul 20, 2001 at 17:13 UTC
    Thats interesting that you say you get good results from the script after you make your change. When I make the same change in my script locally, I receive:
    defined(@array) is deprecated at /usr/lib/perl5/site_perl/5.6.0/Net/DN +S.pm line 137. (Maybe you should just omit the defined()?) syntax error at ./ipnew line 6, near "new Net:" Execution of ./ipnew aborted due to compilation errors.
    I have Net-DNS-0.12 installed and running

    This is perl, v5.6.0 built for i386-linux

    The part about the syntax error near new Net is just out of my grasp. Am I missing something obvious?

    humbly -c

      Your original code only has one colon in that statement which is why you are getting the error.
      Change
      $res = new Net:DNS::Resolver;
      so that it reads
      $res = new Net::DNS::Resolver;