develooper Front page | perl.perl5.porters | Postings from September 2013

Re: [perl #119991] bogus "used only once" warnings

Thread Previous | Thread Next
From:
Vincent Pit
Date:
September 24, 2013 22:33
Subject:
Re: [perl #119991] bogus "used only once" warnings
Message ID:
524206A1.7040009@profvince.com

>
> % perl -we 'sub A::f; BEGIN { 0 if *{"A::f"}{CODE} }'
>
> % perl -we 'sub A::f; BEGIN { 0 if *{"A::g"}{CODE} }'
> Name "A::g" used only once: possible typo at -e line 1.
>
> % perl -we 'BEGIN { 0 if *{"CORE::lc"}{CODE} }'
>
> % perl -we 'BEGIN { 0 if *{"CORE::eval"}{CODE} }'
> Name "CORE::eval" used only once: possible typo at -e line 1.
>
>
> I don't think this code should trigger any "used only once" warnings. I'm
> accessing the symbol table via symbolic references; I'm not using any literal
> variables.

perl 5.14.4 also throws the warning. The difference appears with perl 5.16.

>
> Even so, why does *{"CORE::eval"} warn but not *{"CORE::lc"}?

Here's the list of all of them :

$ perl5.18.1 -MB::Keywords=@Functions -le'for (@Functions) { system 
qq[$^X -we "BEGIN { 0 if *{q<CORE::$_>}{CODE} }"] }'
Name "CORE::AUTOLOAD" used only once: possible typo at -e line 1.
Name "CORE::BEGIN" used only once: possible typo at -e line 1.
Name "CORE::DESTROY" used only once: possible typo at -e line 1.
Name "CORE::END" used only once: possible typo at -e line 1.
Name "CORE::INIT" used only once: possible typo at -e line 1.
Name "CORE::CHECK" used only once: possible typo at -e line 1.
Name "CORE::UNITCHECK" used only once: possible typo at -e line 1.
Name "CORE::dump" used only once: possible typo at -e line 1.
Name "CORE::eval" used only once: possible typo at -e line 1.
Name "CORE::format" used only once: possible typo at -e line 1.
Name "CORE::goto" used only once: possible typo at -e line 1.
Name "CORE::grep" used only once: possible typo at -e line 1.
Name "CORE::import" used only once: possible typo at -e line 1.
Name "CORE::last" used only once: possible typo at -e line 1.
Name "CORE::local" used only once: possible typo at -e line 1.
Name "CORE::map" used only once: possible typo at -e line 1.
Name "CORE::my" used only once: possible typo at -e line 1.
Name "CORE::next" used only once: possible typo at -e line 1.
Name "CORE::our" used only once: possible typo at -e line 1.
Name "CORE::print" used only once: possible typo at -e line 1.
Name "CORE::printf" used only once: possible typo at -e line 1.
Name "CORE::redo" used only once: possible typo at -e line 1.
Name "CORE::require" used only once: possible typo at -e line 1.
Name "CORE::return" used only once: possible typo at -e line 1.
Name "CORE::say" used only once: possible typo at -e line 1.
Name "CORE::sort" used only once: possible typo at -e line 1.
Name "CORE::state" used only once: possible typo at -e line 1.
Name "CORE::unimport" used only once: possible typo at -e line 1.
Name "CORE::use" used only once: possible typo at -e line 1.


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