-=| gregor herrmann, Sun, May 25, 2008 at 12:17:42AM +0200 |=-
> 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-Looks OK to me. The 'no warnings "once"' seems like the right way to do that since the stash name is intentionally unique. -- dam JabberID: [EMAIL PROTECTED]
signature.asc
Description: Digital signature

