Subject: | Nameserver identification on Cygwin (bad split() calls) |
Date: | Mon, 7 Jul 2014 21:47:19 +0000 |
To: | "bug-Net-DNS [...] rt.cpan.org" <bug-Net-DNS [...] rt.cpan.org> |
From: | Nem Schlecht <Nem.Schlecht [...] multibandusa.com> |
Hello - thank you for the excellent Perl module! :)
I have Net::DNS version 0.77 installed, perl 5.14.4 on Cygwin.
In the latest version(s) of Net::DNS, I noticed that split is being called without a pattern argument in lib/Net/DNS/Resolver/cygwin.pm on two lines:
63 my @nt4nameservers = split getregkey( $root, 'NameServer' ) || getregkey( $root, 'DhcpNameServer' );
106 push @nameservers, split $ns if $ns;
However, these return blank, since no pattern is being supplied to split. I'm still running 5.14, so I don't know if this has changed in a later version, but split() usually requires some sort of a pattern argument. These changes work for me and Net::DNS is no longer hanging on my workstation. Also, I see no reason to not have the parens added to the split call (makes it easier to read for me).
63 my @nt4nameservers = split(' ', (getregkey( $root, 'NameServer' ) || getregkey( $root, 'DhcpNameServer' )));
106 push @nameservers, split(' ', $ns) if $ns;
PS: I don't use the module a whole lot, so I don't know how long this issue has been around. I just noticed it this weekend for the first time.
Nem W. Schlecht
Database Administrator
Information Technology
Multiband Corporation
Direct: xxx-xxx-xxxx
Email: nem.schlecht [...] multibandusa.com
Show quoted text
________________________________
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.