Hi. Scalar::Defer 0.15/0.16 spit a "Subroutine AUTOLOAD redefined"
warning sometimes, especially while executing a Makefile.PL with
Module::Install, or loading Jifty::DBI schemata. I hope attached patch
should fix the problem. I also attach a regression test but this may
need to refine.
Thanks,
Kenichi Ishigaki aka charsbar
Subject: | Scalar-Defer-0.16.patch |
diff -ur Scalar-Defer-0.16/lib/Scalar/Defer.pm Scalar-Defer-0.16-patched/lib/Scalar/Defer.pm
--- Scalar-Defer-0.16/lib/Scalar/Defer.pm Tue Jul 1 23:19:38 2008
+++ Scalar-Defer-0.16-patched/lib/Scalar/Defer.pm Fri Aug 8 19:55:42 2008
@@ -101,7 +101,7 @@
};
{
- foreach my $sym (grep { $_ ne 'DESTROY' and $_ ne 'BEGIN' and $_ ne 'END' } keys %UNIVERSAL::) {
+ foreach my $sym (grep { $_ ne 'DESTROY' and $_ ne 'BEGIN' and $_ ne 'END' and $_ ne 'AUTOLOAD' } keys %UNIVERSAL::) {
my $code = q[
sub $sym {
if ( defined Scalar::Util::blessed($_[0]) ) {
Subject: | 03-autoload.t |
use strict;
use warnings;
use Test::More;
eval { require IO::Capture::Stderr };
plan skip_all => 'this test requires IO::Capture::Stderr' if $@;
plan tests => 1;
local $UNIVERSAL::{AUTOLOAD} = sub {};
my $capture = IO::Capture::Stderr->new;
$capture->start;
eval { require Scalar::Defer };
$capture->stop;
my $output = $capture->read;
unlike $output => qr/Subroutine AUTOLOAD redefined/, 'no warning';