in reply to DNS::ZoneParse

While I have no experience with DNS::ZoneParse in particular, you can probably get a good idea of the structure of this hash using Data::Dumper. Once you have a dump of the datastructure, you can check perldsc to get hints on how to pull pieces from the hash. Hopefully this (overly) general advice will help you out some. :)

Update: looking at the docs for DNS::ZoneParse, it looks like soa() returns a pretty straightforward hash reference. Maybe some code like the following will give you an idea how to use it:

my $soa = $zonefile->soa(); print "serial: ", $soa->{serial}, "\n", "origin: ", $soa->{origin}, "\n", "primary: ", $soa->{primary}, "\n";

Note: this is all untested code. I simply made an educated guess from the docs.

Replies are listed 'Best First'.
Re: Re: DNS::ZoneParse
by Bladernr (Novice) on Aug 14, 2003 at 16:26 UTC
    Ahhhh... thank you. THat is what I was missing... I had something like this to print the actual hash:

    print $zonefile->$soa()"\n";

    And had some what I see now as very obviously wrong code to get the various items from the hash... Thanks! If I get this script going the way I want to, I will be sure to put it here somewhere for others to see...