Dear Monks,
i tried adding a TXT record via Net::DNS to a testdomain but having problems with escaping the semicolon.
my $txtdata = "v=DKIM1; k=rsa; t=y;p=MIGfMA0GCSqGSIb3DQAFGQUAA4GNADCBi
+QKBgQDwWV9npEVjm10XoR1NIx174X/SR+BW8yd4RaXMk+pSDwNx0bFK8fPCXf7tLtFbjC
+mYldyhsrnrcloWPVlJkAy41xaTGUcXWpC2Onr/ScbkXa9cuREv4Fy4YmMpHoBKSHoE2JI
+8wBEe4oOoHPojT/b+HTNoZmxfkrYqk5eN5jnUewIDAQAB";
my $a = ";";
my $b = "\\" . ";";
# trying to escape the ;
$txtdata =~ s/$a/$b/g;
my $update = Net::DNS::Update->new("domain.com");
$update->push("update", rr_add("porgy._domainkey.domain.com 600 TXT '$
+txtdata'"));
$update->sign_tsig("keyname", "keysign");
my $res = Net::DNS::Resolver->new;
$res->nameservers("ns.domain2.com");
my $reply = $res->send($update);
If i do a
host -a porgy._domainkey.domain.com ns.domain2.com
I get the TXT record back, but the semicolon is more than once escaped as:
"v=DKIM1\\\; k=rsa\\\; t=y\\\;p=MIGfMA0GC..."
Anyone is seeing an error on my side ?
Thanks
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.