My Perl Quiz

The ultimate place to learn Perl!

Question #43: What gets printed after execution of the following program?

package A;

sub new { return bless {}, shift; }
sub DESTROY { print ref(shift); }


package B;
use base 'A';

sub DESTROY {
    my $self = shift;
    print ref($self);
    bless $self, 'A';
}


package main;

my $obj = B->new();