[dns-operations] creeping poorness of judgement
johnl at taugh.com
Tue Mar 17 02:18:53 UTC 2020
In article <20200317014627.GW68408 at straasha.imrryr.org> you write:
>Yes, the txtdata() method concatenates with spaces in a scalar context.
Net::DNS is pretty funky. The txtdata() output method is something
that someone apparently thought was useful a long time ago but it's
neither the master file format nor the wire format
Here's what it gives you if you ask for that record formatted for a master file,
or hex of the wire format:
print $Net::DNS::VERSION . "\n";
$rr = new Net::DNS::RR( name => 'name',
type => 'TXT',
txtdata => [ 'multiple', 'strings', 'string with spaces' ]
print "master format: "; $rr->print;
print "encoded: ",unpack("H*",$rr->encode(0)),"\n";
$ perl text.pl
master format: name. IN TXT multiple strings "string with spaces"
You get just what you'd expect, no stray spaces in the master record
or in the binary.
John Levine, johnl at taugh.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly
More information about the dns-operations