Could someone help me figure out how to use DNS::ZoneFile? I've tried a few of the different modules for DNS manipulation, but I'm not having much luck. I followed this example and wrote this and tried to just get it to print one zone...

#!/usr/bin/perl -w use strict; use DNS::ZoneFile; my ($ORIGIN,$NEW_ZONE); my $zone=DNS::ZoneFile->new( "../named.master.conf/_dnsmaster", ZONE_ORIGIN=>$ORIGIN, NEW_ZONE=>$NEW_ZONE, ); $zone->printZone( "example.com" );
Running this yields:

> perl Fetchzones.pl Useless use of private variable in void context at /usr/local/lib/perl +5/site_perl/5.6.1/DNS/ZoneFile.pm line 115. Use of implicit split to @_ is deprecated at /usr/local/lib/perl5/site +_perl/5.6.1/DNS/ZoneFile.pm line 220. Use of implicit split to @_ is deprecated at /usr/local/lib/perl5/site +_perl/5.6.1/DNS/ZoneFile.pm line 240. Use of implicit split to @_ is deprecated at /usr/local/lib/perl5/site +_perl/5.6.1/DNS/ZoneFile.pm line 260. Explicit blessing to '' (assuming package main) at /usr/local/lib/perl +5/site_perl/5.6.1/DNS/ZoneFile.pm line 133. Can't locate object method "readZoneFile" via package "main" (perhaps +you forgot to load "main"?) at /usr/local/lib/perl5/site_perl/5.6.1/D +NS/ZoneFile.pm line 139.

Not sure how to interpret this error message...

What I'm trying to accomplish is to make a script to read a bind 8 named.conf file and tell me the filename for each master zone.

~~
naChoZ


In reply to DNS::ZoneFile by naChoZ

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.