On Wed, 14 May 2008 22:13:24 +0200, gregor herrmann wrote:

> The bug report at CPAN points out the leading space after the opening
> quote, and indeed there's an interesting comment in the source code:
> 
> lib/Class/MethodMaker/Engine.pm:
> 
> 779  # Generate a unique stash name for the sub.  Use a preceding space
> 780  # to avoid collisions with anything in the Perl space.
> 781  Class::MethodMaker::set_sub_name($code, $target, $name, " 
> ${target}::${name}");
> 
> Removing the leading space shuts up the warnings when running the
> tests during build; I'm just not sure about any possible side effects
> ...

Another possibility is to turn off this specific type of warnings
locally in the if() condition. I've committed the following patch to
our svn repo:

#v+

Author: gregor herrmann <[EMAIL PROTECTED]>
Bugs: #481227, CPAN#35840
Description: locally turn off warning 'Name " Foo::Bar" used only once'

--- libclass-methodmaker-perl.orig/lib/Class/MethodMaker/Engine.pm
+++ libclass-methodmaker-perl/lib/Class/MethodMaker/Engine.pm
@@ -778,6 +778,8 @@
         *{$methname} = $code;
         # Generate a unique stash name for the sub.  Use a preceding space
         # to avoid collisions with anything in the Perl space.
+        # Turn off warnings about 'Name " Foo::Bar" used only once'.
+        no warnings "once";
         Class::MethodMaker::set_sub_name($code, $target, $name, " 
${target}::${name}");
       }
     } else {

#v-

Any comments?

Cheers,
gregor

-- 
 .''`.   http://info.comodo.priv.at/ | gpg key ID: 0x00F3CFE4
 : :' :  debian gnu/linux user, admin & developer - http://www.debian.org/
 `. `'   member of https://www.vibe.at/ | how to reply: http://got.to/quote/
   `-    NP: Beatles

Attachment: signature.asc
Description: Digital signature

Reply via email to