Good day all I have a problem with a script I am using to
parse DNS zone data it looks as if my parse runs
but my output looks very strange instead of a
filename that looks like "file.com" I am getting
"file
.com"
readmore
I have attached the code so you all can see it and
maybe give me some insite as to why my output is munged
#!/usr/bin/perl -w
$| = 1;
use DNS::ZoneParse;
use Data::Dumper;
$out_dir = "/var/tmp/abs";
$list = "/var/tmp/list";
open(IN, "$list");
@files = <IN>;
for(@files) {
$line = "$_";
$out = join('.', ( split('/', $line) )[-1,-2]);
$dns = DNS::ZoneParse->new("$line");
open(OUT, ">$out_dir/$out") or die "Cant create $out_dir/$out: $!\n
+";
print OUT Data::Dumper->Dump([$dns->soa]) . "\n";
close(OUT);
}
close(IN);
exit;
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.