This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Suppress "Name used only once" warnings.
authorDavid E. Wheeler <david@kineticode.com>
Fri, 28 Jan 2011 04:33:44 +0000 (20:33 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 28 Jan 2011 05:41:39 +0000 (21:41 -0800)
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
dist/Locale-Maketext/lib/Locale/Maketext.pm

index 87280b7..e767aac 100644 (file)
@@ -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!
index 042ecf7..b429778 100644 (file)
@@ -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!