develooper Front page | perl.perl5.porters | Postings from December 2010

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

Thread Previous | Thread Next
From:
David E. Wheeler
Date:
December 28, 2010 15:27
Subject:
Re: [PATCH] Suppress "Name used only once" warnings.
Message ID:
A8066D75-844C-4C8C-9858-A519F24D893F@kineticode.com
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
> 


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