Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

DNS script troubles

by perlaintdead (Scribe)
on Apr 28, 2012 at 00:26 UTC ( #967746=perlquestion: print w/replies, xml ) Need Help??
perlaintdead has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks, I'v been having trouble with this code:



print "Web-Sorrow (Extra Tool) DNSpull v1"; use Net::DNS; use Getopt::Long; use warnings; use strict; my $Host = "none"; GetOptions("host=s" => \$Host); # usage if($Host eq "none"){ print "Usage: perl DNSpull.pl -host example.com\n\t-host - domai +n name\n"; exit(); } print "+ ptr mx txt A AAAA KX IN records:\n" $packet = Net::DNS::Packet->new(); $res = $packet->query($Host, "PTR", "MX", "TXT", "A", "AAAA", "KX", "I +N"); print $res->string;

it crashes ever time i run it. and I have installed all the Modules

Replies are listed 'Best First'.
Re: DNS script troubles
by phenom (Chaplain) on Apr 28, 2012 at 00:48 UTC
    You should spell out what errors you're getting. Also, you're missing a colon on this line:
    print "+ ptr mx txt A AAAA KX IN records:\n"
    And you didn't declare $packet or $res.
      I get A windows dialog box: the perl interpreter has stoped woking
        Have you *declared* the 2 variables phenom told you about: $packet, $res?

        I suspect that is your problem.

        Did you fix those errors I mentioned in the previous post?

        Also, I don't believe there's a "query" method in that module. Are you thinking of a different module? Try re-reading the documentation for that module.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://967746]
Approved by lidden
help
Chatterbox?
[Corion]: Two-way data binding means that if you change something in a text box, the corresponding variable in your Javascript gets updated immediately as well, and if you then change the variable, the corresponding text box also gets updated
[Corion]: That is a horrible approach that was also taken by Access, but if you have hooks that prevent automatic saving to the database, it is incredibly handy

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2017-03-30 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (355 votes). Check out past polls.