Skip Menu |

This queue is for tickets about the Class-Std CPAN distribution.

Report information
The Basics
Id: 44095
Status: open
Priority: 0/
Queue: Class-Std

People
Owner: Nobody in particular
Requestors: sergle.ua [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: warning Called UNIVERSAL::can() as a function, not a method
FreeBSD 6.3-RELEASE-p1, perl v5.8.8. Class::Std - 0.0.8 and 0.0.9 Got warinings Called UNIVERSAL::can() as a function, not a method at /tmp/Class-Std-0.0.9.orig/lib/Class/Std.pm line 564 Attached patch just a workaround for UNIVERSAL/can.pm, subroutine _report_warning - it's checks caller name. I'm unable to make simple example to reproduce.
Subject: can.patch
diff -urN Class-Std-0.0.9.orig/lib/Class/Std.pm Class-Std-0.0.9.patched/lib/Class/Std.pm --- Class-Std-0.0.9.orig/lib/Class/Std.pm 2008-03-25 03:08:57.000000000 +0200 +++ Class-Std-0.0.9.patched/lib/Class/Std.pm 2009-01-26 15:09:57.000000000 +0200 @@ -556,8 +556,7 @@ { my $real_can = \&UNIVERSAL::can; - no warnings 'redefine', 'once'; - *UNIVERSAL::can = sub { + sub can { my ($invocant, $method_name) = @_; if ( defined $invocant ) { @@ -579,6 +578,9 @@ return; }; + + no warnings 'redefine', 'once'; + *UNIVERSAL::can = \&can; } package Class::Std::SCR;
Subject: Re: [rt.cpan.org #44095] warning Called UNIVERSAL::can() as a function, not a method
Date: Mon, 16 Mar 2009 10:00:47 +1100
To: bug-Class-Std [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
> Attached patch just a workaround for UNIVERSAL/can.pm, subroutine > _report_warning - it's checks caller name.
Thanks, Sergey! Damian