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

Re: $EXPORT_ALL now warns

Thread Previous | Thread Next
November 20, 2017 09:05
Re: $EXPORT_ALL now warns
Message ID:
On 19 Nov 2017 16:20, "Sawyer X" <> wrote:

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 <>
>> 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.

Fwiw if we want to restore the old behaviour while we reconsider things i
pushed a branch this weekend which contains the required patch.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About