Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 107053
Status: rejected
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: kes-kes [...] yandex.ru
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)



Subject: useless statement
Net::DNS::Domain:57 use constant LIBIDN => UTF8 && defined eval { require Net::LibIDN; }; can be rewriten as: use constant LIBIDN => UTF8; eval { require Net::LibIDN; }; may be you mean: defined eval { require Net::LibIDN; } && use constant LIBIDN => UTF8;
From: rwfranks [...] acm.org
On Sat Sep 12 06:18:44 2015, kes-kes@yandex.ru wrote: Show quoted text
> Net::DNS::Domain:57 > > use constant LIBIDN => UTF8 && defined eval { require Net::LibIDN; }; > > can be rewriten as: > > use constant LIBIDN => UTF8; > eval { require Net::LibIDN; }; > > may be you mean: > > defined eval { require Net::LibIDN; } && use constant LIBIDN => UTF8;
This is not a beauty contest. Every version of every compiler from 4.4.4 to 5.23.2 understands the meaning of this code. Every ugly feature got there for a reason.
On 2015-09-12 06:18:44, kes-kes@yandex.ru wrote: Show quoted text
> Net::DNS::Domain:57 > > use constant LIBIDN => UTF8 && defined eval { require Net::LibIDN; }; > > can be rewriten as: > > use constant LIBIDN => UTF8; > eval { require Net::LibIDN; }; > > may be you mean: > > defined eval { require Net::LibIDN; } && use constant LIBIDN => UTF8;
This does not work, because you try to do a compile-time statement depending on a runtime condition. Also, it's inefficient if UTF8 is false; in this case the code would needlessly load Net::LibIDN. But the current code in Net::DNS::Domain actually works, I think.
From: kes-kes [...] yandex.ru
Show quoted text
> > use constant LIBIDN => UTF8 && defined eval { require Net::LibIDN; };
Sorry, I lose priority. That mean: use constant LIBIDN => ( UTF8 && defined eval { require Net::LibIDN; } ); But I think: ( use constant LIBIDN => UTF8 ) && ( defined eval { require Net::LibIDN; } );
From: rwfranks [...] acm.org
On Mon Sep 14 16:07:05 2015, kes-kes@yandex.ru wrote: Show quoted text
> > > use constant LIBIDN => UTF8 && defined eval { require Net::LibIDN; > > > };
> > Sorry, I lose priority. That mean: > > use constant LIBIDN => ( UTF8 && defined eval { require Net::LibIDN; } > ); > > But I think: > ( use constant LIBIDN => UTF8 ) && ( defined eval { require > Net::LibIDN; } );
You are arguing the unarguable! 1) The code is good and there are at least 40000 successful test results in CPANtesters.org which serve to underline the point. 2) I wrote the code, understand very well how it works, and will fix any faults if there ever are any. 3) Unless you can write a test script that demonstrates a bug, there is nothing more to be said.