develooper Front page | perl.perl5.porters | Postings from January 2011

Re: [PATCH] Suppress "Name used only once" warnings.

Thread Previous | Thread Next
From:
David E. Wheeler
Date:
January 27, 2011 17:48
Subject:
Re: [PATCH] Suppress "Name used only once" warnings.
Message ID:
4C57E191-4540-4F70-B926-0BA0A216C7F7@kineticode.com
So, anyone want to apply this? Should I re-submit it via perlbug?

Best,

David

On Dec 29, 2010, at 9:54 AM, Todd Rinaldo wrote:

> Now that I have the required modules installed, CPANPLUS test suite blows up too:
> 
> "IPC::Cmd::I18N::en::Lexicon" used only once: possible typo at /usr/local/lib/perl5/5.12.2/Locale/Maketext.pm line 443.
> 
> On Dec 28, 2010, at 5:27 PM, David E. Wheeler wrote:
> 
>> Turns out that it requires the latest IPC::Cmd (which I think is in blead already) and Locale::Maketext::Lexicon from CPAN. Then the warnings will show up with
>> 
>>   perl -Idist/Locale-Maketext/lib -Icpan/IPC-Cmd/lib -Idist/I18N-LangTags/lib -we "use IPC::Cmd"
>> 
>> I'm confused as to why Locale::Maketext::Simple, which bills itself as "a Simple interface to Locale::Maketext::Lexicon", is in core, but Locale::Maketext::Lexicon is not.
>> 
>> Best,
>> 
>> David
>> 
>> On Dec 28, 2010, at 2:51 PM, David E. Wheeler wrote:
>> 
>>> From Locale::Maketext and I18N::LangTags::Detect. To replicate, run
>>>  perl -Idist/Locale-Maketext/lib -Icpan/IPC-Cmd/lib -Idist/I18N-LangTags/lib -we "use IPC::Cmd"
>>> ---
>>> dist/I18N-LangTags/lib/I18N/LangTags/Detect.pm |    1 +
>>> dist/Locale-Maketext/lib/Locale/Maketext.pm    |    1 +
>>> 2 files changed, 2 insertions(+), 0 deletions(-)
>>> 
>>> diff --git a/dist/I18N-LangTags/lib/I18N/LangTags/Detect.pm b/dist/I18N-LangTags/lib/I18N/LangTags/Detect.pm
>>> index 87280b7..e767aac 100644
>>> --- a/dist/I18N-LangTags/lib/I18N/LangTags/Detect.pm
>>> +++ b/dist/I18N-LangTags/lib/I18N/LangTags/Detect.pm
>>> @@ -136,6 +136,7 @@ sub _try_use {   # Basically a wrapper around "require Modulename"
>>> 
>>> my $module = $_[0];   # ASSUME sane module name!
>>> { no strict 'refs';
>>> +    no warnings 'once';
>>>   return($tried{$module} = 1)
>>>    if %{$module . "::Lexicon"} or @{$module . "::ISA"};
>>>   # weird case: we never use'd it, but there it is!
>>> diff --git a/dist/Locale-Maketext/lib/Locale/Maketext.pm b/dist/Locale-Maketext/lib/Locale/Maketext.pm
>>> index 6c084e3..1c147fc 100644
>>> --- a/dist/Locale-Maketext/lib/Locale/Maketext.pm
>>> +++ b/dist/Locale-Maketext/lib/Locale/Maketext.pm
>>> @@ -439,6 +439,7 @@ sub _try_use {   # Basically a wrapper around "require Modulename"
>>> 
>>>   my $module = $_[0];   # ASSUME sane module name!
>>>   { no strict 'refs';
>>> +        no warnings 'once';
>>>       return($tried{$module} = 1)
>>>       if %{$module . '::Lexicon'} or @{$module . '::ISA'};
>>>       # weird case: we never use'd it, but there it is!
>>> -- 
>>> 1.7.1
>>> 
>> 
> 
> Todd Rinaldo
> toddr@cpanel.net
> 
> 


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