Re: [Catalyst] Perl 5.10 warnings. ("used only once")

2008-11-06 Thread Bill Moseley
On Mon, Nov 03, 2008 at 07:18:46AM -0800, Bill Moseley wrote:
> I know some of this has been discussed:
> 
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/msg02634.html
> 
> I installed Perl 5.10 and Catalyst 5.7015, and now "make test"
> generates lots of:
> 
> Name "Catalyst::Controller::setup_dispatcher" used only once:
> possible typo at /usr/share/perl/5.10/NEXT.pm line 58.

I patched my NEXT.pm which seemed to suppress it.  I've attached.
Does just setting a scalar by the same name to undef seem like a
reasonable way to suppress this noise?

Hum, I see I've got 0.60_01 of NEXT.pm  Not sure where I got that
version, or if maybe that was some other hack I did locally at one
point.

Something makes me think NEXT.pm doesn't meet the standards of PBP. ;)



-- 
Bill Moseley
[EMAIL PROTECTED]
Sent from my iMutt

--- NEXT.orig	2008-11-06 11:56:40.0 -0800
+++ NEXT.pm	2008-11-06 11:57:15.0 -0800
@@ -1,8 +1,9 @@
 package NEXT;
-$VERSION = '0.60_01';
+$VERSION = '0.60_02';
 use Carp;
 use strict;
 
+
 sub NEXT::ELSEWHERE::ancestors
 {
 	my @inlist = shift;
@@ -54,12 +55,24 @@
 			last if shift @forebears eq $caller_class
 		}
 		no strict 'refs';
-		@{$NEXT::NEXT{$self,$wanted_method}} = 
-			map { *{"${_}::$caller_method"}{CODE}||() } @forebears
-unless $wanted_method eq 'AUTOLOAD';
-		@{$NEXT::NEXT{$self,$wanted_method}} = 
-			map { (*{"${_}::AUTOLOAD"}{CODE}) ? "${_}::AUTOLOAD" : ()} @forebears
-unless @{$NEXT::NEXT{$self,$wanted_method}||[]};
+
+unless ( $wanted_method eq 'AUTOLOAD' ) {
+@{$NEXT::NEXT{$self,$wanted_method}} = 
+map { *{"${_}::$caller_method"}{CODE}||() } @forebears;
+
+# Suppress "used only once" warnings
+${"${_}::$caller_method"} = undef  for @forebears;
+}
+
+
+unless ( @{$NEXT::NEXT{$self,$wanted_method}||[]} ) {
+@{$NEXT::NEXT{$self,$wanted_method}} = 
+map { (*{"${_}::AUTOLOAD"}{CODE}) ? "${_}::AUTOLOAD" : ()} @forebears;
+
+# Suppress "used only once" warnings
+${"${_}::AUTOLOAD"} = undef for @forebears;
+}
+
 		$NEXT::SEEN->{$self,*{$caller}{CODE}}++;
 	}
 	my $call_method = shift @{$NEXT::NEXT{$self,$wanted_method}};
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Perl 5.10 warnings. ("used only once")

2008-11-06 Thread Greg Matheson
On Thu, 06 Nov 2008, Bill Moseley wrote:

> > Name "Catalyst::Controller::setup_dispatcher" used only once:
> > possible typo at /usr/share/perl/5.10/NEXT.pm line 58.

> I patched my NEXT.pm which seemed to suppress it.  I've attached.
> Does just setting a scalar by the same name to undef seem like a
> reasonable way to suppress this noise?

Someone on #perl suggested 'no warnings "only"', or something.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Perl 5.10 warnings. ("used only once")

2009-01-10 Thread Chisel Wright
On Fri, Nov 07, 2008 at 12:09:54AM +, Greg Matheson wrote:
> On Thu, 06 Nov 2008, Bill Moseley wrote:
> 
> > > Name "Catalyst::Controller::setup_dispatcher" used only once:
> > > possible typo at /usr/share/perl/5.10/NEXT.pm line 58.
> 
> > I patched my NEXT.pm which seemed to suppress it.  I've attached.
> > Does just setting a scalar by the same name to undef seem like a
> > reasonable way to suppress this noise?
> 
> Someone on #perl suggested 'no warnings "only"', or something.

Was this resolved?

I've not been able to find anything tonight. I know it's not critical,
but I'd quite like to clean up my output/logs.

Chiz
-- 
Chisel Wright
e: chi...@herlpacker.co.uk
w: http://www.herlpacker.co.uk/

  Pink is my favourite crayon

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Perl 5.10 warnings. ("used only once")

2009-01-10 Thread Greg Matheson
On Sun, 11 Jan 2009, Chisel Wright wrote:

> On Fri, Nov 07, 2008 at 12:09:54AM +, Greg Matheson wrote:
> > On Thu, 06 Nov 2008, Bill Moseley wrote:

> > > > Name "Catalyst::Controller::setup_dispatcher" used only once:
> > > > possible typo at /usr/share/perl/5.10/NEXT.pm line 58.

> > > I patched my NEXT.pm which seemed to suppress it.  I've attached.
> > > Does just setting a scalar by the same name to undef seem like a
> > > reasonable way to suppress this noise?

> > Someone on #perl suggested 'no warnings "only"', or something.

> Was this resolved?

> I've not been able to find anything tonight. I know it's not critical,
> but I'd quite like to clean up my output/logs.

perllexwarn doesn't say what "no warnings 'once'" will do, but 
patched into the offending module, it turns off the warning about 
names used only once.

The 'warnings' man page also doesn't say it will do this either.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/