Closed p5pRT closed 7 months ago
This code:
use strict; use warnings FATAL => qw(once); print @Foo::bar\, "\n"; print "still alive\n";
Should be fatal. Instead\, it prints:
Name "Foo::bar" used only once: possible typo at foo.pl line 3.
still alive
(Behaviour is the same with "use warnings FATAL => 'all'".)
On Fri May 09 14:25:09 2014\, ether@cpan.org wrote:
This code:
use strict; use warnings FATAL => qw(once); print @Foo::bar\, "\n"; print "still alive\n";
Should be fatal. Instead\, it prints:
Name "Foo::bar" used only once: possible typo at foo.pl line 3.
still alive
(Behaviour is the same with "use warnings FATAL => 'all'".)
The cause I think is that the checks for WARN_ONCE aren't done until after compilation is complete and before execution starts\, so PL_curcop isn't the cop where the global is being referenced.
The warning itself is suppressed as the code is compiled by Perl_gv_fetchpvn_flags() which sets GvMULTI_on() on the gv if WARN_ONCE isn't set.
I don't see a simple way to fix it.
Tony
The RT System itself - Status changed from 'new' to 'open'
From @tonycoz
On Fri May 09 14:25:09 2014, ether@cpan.org wrote:
This code: use strict; use warnings FATAL => qw(once); print @Foo::bar, "\n"; print "still alive\n"; Should be fatal. Instead, it prints: Name "Foo::bar" used only once: possible typo at foo.pl line 3. still alive (Behaviour is the same with "use warnings FATAL => 'all'".)
The cause I think is that the checks for WARN_ONCE aren't done until after compilation is complete and before execution starts, so PL_curcop isn't the cop where the global is being referenced.
The warning itself is suppressed as the code is compiled by Perl_gv_fetchpvn_flags() which sets GvMULTI_on() on the gv if WARN_ONCE isn't set.
I don't see a simple way to fix it.
Tony
@tonycoz , @karenetheridge , is this ticket closable?
I think it's fixable by adding a GV flag to indicate warnings were fatal when the name was seen.
I've added this to my assigned list, though if anyone else wants to look at it they're welcome to try.
Migrated from rt.perl.org#121834 (status was 'open')
Searchable as RT121834$