Subject: | Parse issue in Net::DNS::RR->token |
Date: | Mon, 27 Jan 2020 23:07:38 -0500 (EST) |
To: | bug-Net-DNS [...] rt.cpan.org |
From: | Rob Foehl <rwf [...] loonybin.net> |
There appears to be an issue with splitting certain strings containing
semicolons due to the current value of $PARSE_REGEX as used in
Net::DNS::RR->token, e.g. TXT rdata. Simple reproducer and workaround:
╶➤ perl -MNet::DNS -le 'print Net::DNS::RR->new(name => "example.com", type => "TXT", txtdata => "x=1;y=2")->plain'
example.com. IN TXT x=1\
╶➤ perl -MNet::DNS -le 'print Net::DNS::RR->new(name => "example.com", type => "TXT", txtdata => "x=1; y=2")->plain'
example.com. IN TXT "x=1; y=2"
That erroneous backslash is the last character output, and the rest of the
string is also unavailable when token is called in list context. Issue
confirmed in at least 1.19 and 1.21, haven't checked other versions.
-Rob