develooper Front page | perl.perl5.porters | Postings from April 2014

[perl #121766] Creating accessor method using SUPER name stopped to work

Thread Previous
Tony Cook via RT
April 30, 2014 06:31
[perl #121766] Creating accessor method using SUPER name stopped to work
Message ID:
On Tue Apr 29 15:13:01 2014, wrote:
> The following test program demonstrates a regression in perl 5.18:
> 	@Class2::ISA = qw(Class1);
> 	sub Class1::AUTOLOAD {
> 		*{$Class1::AUTOLOAD} = sub { print "defined\n" };
> 		print "autoloaded\n";
> 	}
> 	Class2->Class2::SUPER::a;
> 	Class2->Class2::SUPER::a;
> 	Class2->a;
> 	Class2->a;
> In perl versions prior to 5.18.0 it prints:
> 	autoloaded
> 	defined
> 	autoloaded
> 	defined
> In 5.18.0 (and 5.18.2) it prints "autoloaded" 3 times in a row.
> And Class2->can('Class2::SUPER::a') returns undef instead of CODE,
> although the method gets re-defined every time, causing warnings
> "Subroutine SubClass::SUPER::method redefined" in my real code.

Bisected to:

aae438050a206a8067e068319ab3ee2348009463 is the first bad commit
commit aae438050a206a8067e068319ab3ee2348009463
Author: Father Chrysostomos <>
Date:   Mon Sep 17 16:24:40 2012 -0700

    [perl #114924] Make method calls work with ::SUPER packages
    Perl caches SUPER methods inside packages named Foo::SUPER.  But this
    interferes with actual method calls on those packages (SUPER->foo,
    The first time a package is looked up, it is vivified under the name
    with which it is looked up.  So *SUPER:: will cause that package
    to be called SUPER, and *main::SUPER:: will cause it to be named
    main->SUPER::isa used to be very sensitive to the name of the
    main::FOO package (where the cache is kept).  If it happened to be
    called SUPER, that call would fail.

via perlbug:  queue: perl5 status: new

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About