Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: ZHENYZ [...] cpan.org
Cc:
AdminCc:

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



Subject: local @INC in Net::DNS::RR does not support objects/hooks.
See this line https://metacpan.org/source/NLNETLABS/Net-DNS-1.09/lib/Net/DNS/RR.pm#L39 Seems to be introduced since version 1.07 but I don't find it described in Changelog. When it stores @INC to LIB, it now accepts only plain strings and filters out complex items. I wonder why it's designed this way. In our company we use object in @INC. We store each CPAN package's files into all different directories from other packages. The object we use in @INC serves as cache for what files contained within a package. And it in a string context evaluates to a lib path. With recent versions of DNS::Net our mechanism has got broken because of the line mentioned above. I would suggest removing that filter at that line. I don't see the reason of the grep operation. use constant LIB => @INC;
From: rwfranks [...] acm.org
On Wed May 03 03:03:45 2017, ZHENYZ wrote: Show quoted text
> See this line https://metacpan.org/source/NLNETLABS/Net-DNS- > 1.09/lib/Net/DNS/RR.pm#L39 Seems to be introduced since version 1.07 > but I don't find it described in Changelog. > > When it stores @INC to LIB, it now accepts only plain strings and > filters out complex items. I wonder why it's designed this way.
This is intended to ensure that RR subtype implementation modules are drawn from the same library as RR.pm itself, irrespective of subsequent changes to @INC. Show quoted text
> In our company we use object in @INC. We store each CPAN package's > files into all different directories from other packages. The object > we use in @INC serves as cache for what files contained within a > package. And it in a string context evaluates to a lib path. With > recent versions of DNS::Net our mechanism has got broken because of > the line mentioned above.
We make the reasonable presumption that Net::DNS was installed using the standard method described in the Perl documentation. If you chose to depart from the standard model, then you must accept responsibility for any adverse consequences which flow from that decision. LIB is used in one place, and one place only, to populate the localised @INC used internally to load RR subtypes. It is therefore your redefinition of @INC which breaks our code, not the other way around. Show quoted text
> I would suggest removing that filter at that line. I don't see the > reason of the grep operation. > > use constant LIB => @INC;
The filter is intended to disallow execution of external code which changes the behaviour of Net::DNS.