This PR: https://github.com/Perl/perl5/pull/21915
Discussing this in PSC meeting, on further observation it feels like we
might want to revert this commit.
It is causing various test collateral damage, e.g.
https://github.com/Perl/perl5/issues/21995
It only warns in this one specific order - package then lexical; it
would not warn in the arguably much-more-likely case of lexical then
package (e.g. because of use VERSION implicit imports). So it's not
very useful to users.
The analogous case using variables does not cause a warning (other than
the 'once' warning):
$ perl -Mwarnings -M-warnings=once -cE '$main::var = 123; my $var = 456'
-e syntax OK
$ perl -ce'use strict; use warnings; use vars q[$foo]; my $foo = 1;'
-e syntax OK
All of these reasons suggest that maybe this wants to be removed. More
discussion may be required.
--
Paul "LeoNerd" Evans
leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/
Discussing this in PSC meeting, on further observation it feels like we
might want to revert this commit.
It is causing various test collateral damage, e.g.
https://github.com/Perl/perl5/issues/21995
It only warns in this one specific order - package then lexical; it
would not warn in the arguably much-more-likely case of lexical then
package (e.g. because of use VERSION implicit imports). So it's not
very useful to users.
The analogous case using variables does not cause a warning (other than
the 'once' warning):
$ perl -Mwarnings -M-warnings=once -cE '$main::var = 123; my $var = 456'
-e syntax OK
$ perl -ce'use strict; use warnings; use vars q[$foo]; my $foo = 1;'
-e syntax OK
All of these reasons suggest that maybe this wants to be removed. More
discussion may be required.
--
Paul "LeoNerd" Evans
leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/