develooper Front page | perl.perl5.porters | Postings from October 2016

Re: [perl #129981] EXPORT_TAGS no longer immune to once warnings

Thread Previous | Thread Next
From:
demerphq
Date:
October 29, 2016 17:47
Subject:
Re: [perl #129981] EXPORT_TAGS no longer immune to once warnings
Message ID:
CANgJU+Xzoqd5BCMnQtvMqcWo3mX=TKt0qQrFHkhW606hbpDyJQ@mail.gmail.com
On 29 October 2016 at 16:30, Father Chrysostomos via RT
<perlbug-followup@perl.org> wrote:
> On Thu Oct 27 23:58:15 2016, demerphq wrote:
>> Yes. I did.
>>
>> commit 055ae706a0637a77ba440aedf596d2ebac642051
>> Author: Yves Orton <demerphq@gmail.com>
>> Date:   Thu Oct 27 15:36:27 2016 +0200
>>
>>     must check all the EXPORT vars in two places!
>>
>>     (Silence lots of used once warnings we used to not generate)
>
> Your original commit message said:
>
>> 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 do not think it was inadvertent.  I believe there are other EXPORT_* variables also used, but grep.cpan.me is down right now.
>
> In any case, I think there *should* be a prefix match for EXPORT*.

We don't document such an exemption. And when in place it means that
if people typo and EXPORT related var name then there are no warnings.
Eg, these should trigger used only once warnings:

@EXPORT_oK= qw( ... );
@EXPORTOK= qw();
@EXPORT__OK=qw();

But without my patch none of them will. I am fine if we add more
specific var names, but I really think we should have to enumerate
them, especially as they should be documented in PERLVAR too.

Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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