Subject: | [Patch] Parse TXT records with a ; |
Date: | Wed, 07 Oct 2009 10:32:01 +0200 |
To: | bug-DNS-ZoneParse [...] rt.cpan.org |
From: | Pierre LEBRECH <pierre.lebrech [...] laposte.net> |
Hello,
As I needed a corrected version, I decided to modify the source code of ZoneParse.pm.
Feedback : the problem was that DKIM introduces some ";" in the rdata field of TXT records.
A patch is appended to this mail :
It works fine for me.
319c319,327
< $zone =~ s<\;.*$> <>mg; # Remove comments
---
> my @records2 = grep !/^$/, split (m|$/|, $zone);
> my $file2;
>
> foreach my $line2 (@records2) {
> $_ = $line2;
> $line2 =~ s<\;.*$> <>mg unless /TXT/; # Remove comments except if there is a TXT
> $file2 .= $line2 . $/;
> }
> $zone = $file2;