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

Re: $EXPORT_ALL now warns

Thread Previous | Thread Next
From:
demerphq
Date:
November 17, 2017 08:45
Subject:
Re: $EXPORT_ALL now warns
Message ID:
CANgJU+Wk_eb=P19PaOo4ZBp8brfb4WuUkYUEm9U9Y6A9mDbiLg@mail.gmail.com
On 17 Nov 2017 05:11, "Father Chrysostomos" <sprout@cpan.org> 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.


We discussed it as the time and decided that since it meant

@EXPORT_ALLL

and similar typos would be silently ignored and that the behaviour was
undocumented this change was warranted.


This commit changed the behaviour, such that @EXPORT does not warn,
but EXPORT_ANY (used on CPAN) does warn.  (See rt.cpan.org #123633.)
If I had known about this change in behaviour at the time, I would
have spoken up.


But maybe not won the case.


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.


I don't think that is the right thing to do frankly.



Also, if someone is committing a change that changes observable behav-
iour, please make the first line of the commit message say so.  This:

>     gv.c: rework special var matching logic to be simpler

does not sound like a commit worth looking at.  It sounds like a pure
refactoring.  This:

>     gv.c: Stop doing prefix matching on special vars

would at least have prompted me to take a closer look.



Ok, fair enough on the commit message.

Yves

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