develooper Front page | perl.perl5.porters | Postings from November 2017

Re: $EXPORT_ALL now warns

Thread Previous | Thread Next
From:
Sawyer X
Date:
November 19, 2017 15:20
Subject:
Re: $EXPORT_ALL now warns
Message ID:
a2838db0-16c2-8280-4512-4d9d822f7a7d@gmail.com


On 11/17/2017 05:10 AM, Father Chrysostomos wrote:
> $EXPORT_ALL now warns
>
> Yves Orton made this commit about a year ago:
>> commit eafd371ce091bf61fe1673448eee5e53c4b0ef32
>> Author: Yves Orton <demerphq@gmail.com>
>> Date:   Wed Oct 19 11:09:00 2016 +0200
>>
>>     gv.c: rework special var matching logic to be simpler
>>     
>>     The old code used a bunch of tricks that IMO are unlikely
>>     to actually make any performance difference, and make
>>     the code harder to read, search, and understand, and less
>>     amenable to using string constant friendly macros.
>>     
>>     So for instance instead of switching on the first char
>>     and then comparing the second on for an exact match
>>     instead just compare the full string. The extra char
>>     is unlikely to make a difference to the underlying code
>>     that gets called, and the end result is easier searching.
>>     
>>     Another issue is that some of the code was inadverdantly
>>     doing prefix matches, and not exact matchs for certain
>>     magic var names. This is fixed as part of these changes.
> I would argu that the EXPORT check was not inadvertently a prefix
> check.  And when somebody proposed changing it in another thread a
> few years back, I cited various CPAN modules that showed that people
> were relying on it.

Was this intentional behavior expressed in any form? Is it part of any
documentation or promised behavior?

Because otherwise, I honestly would be in favor of removing this. I
looked at the commit change and the previous code felt... overtly flexible.

The benefit of being exact means we can spot typos as well, which is an
added benefit of being stricter.

[...]

>
> In any case, I recommend we revert to the previous behaviour of
> exempting anything beginning with EXPORT from 'used once' warn-
> ings.  And the change should be backported to 5.26.x, since it is a
> regression.

It should also accompany a perldelta change.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About