Subject: | zoneparse cannot add new records |
Date: | Mon, 14 Mar 2011 16:06:17 -0700 |
To: | <bug-DNS-ZoneParse [...] rt.cpan.org> |
From: | <scott_stone [...] trendmicro.com> |
OS version: fully patched (as of Mar 14 2011) CentOS 5.5
PERL version: v5.8.8 built for x86_64-linux-thread-multi
ZoneParse version: 1.10
Problem description: I'm trying to load a zone, add records to it, and write the file back out. The manpage has an example of how to do this, but it doesn't work.
The reason it doesn't work is because when you get the A records with:
my $a_records = $zonefile->a();
and then push data with "push @$a_records, { ... data ..}", you're pushing the data to the COPY of the A records, not the records inside the master data structure, so when you do:
my $newfile = $zonefile->output();
The new record is not there.
I'm working on a patch to add methods to push data back into the internal data structures, but I thought I would report this in case there's a way to accomplish this that I'm either not seeing or.. something. I thought that my use of strict references might be the problem, but removing "use strict" does not solve the problem.
====================
Scott Stone <scott_stone@trendmicro.com>
Lead Developer, DCS-RD
Trend Micro, Inc. http://www.trendmicro.com
TREND MICRO EMAIL NOTICE
The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.