Mailing List Archive

perlbot update (Re: super2 package)
Here's an update to perlbot. Apply to the perlbot found in 5.001m. This
replaces the ::Inherit:: stuff with the new SUPER pseudo-class.

Dean


*** pod/perlbot.pod Mon Jun 5 16:37:38 1995
--- ../patches/perlbot.pod Tue Oct 31 15:05:25 1995
***************
*** 199,210 ****

=head1 OVERRIDING SUPERCLASS METHODS

! The following example demonstrates how one might override a superclass
! method and then call the method after it has been overridden. The
! Foo::Inherit class allows the programmer to call an overridden superclass
! method without actually knowing where that method is defined.

-
package Buz;
sub goo { print "here's the goo\n" }

--- 199,209 ----

=head1 OVERRIDING SUPERCLASS METHODS

! The following example demonstrates how to override a superclass method and
! then call the overridden method. The B<SUPER> pseudo-class allows the
! programmer to call an overridden superclass method without actually knowing
! where that method is defined.

package Buz;
sub goo { print "here's the goo\n" }

***************
*** 216,222 ****

package Foo;
@ISA = qw( Bar Baz );
- @Foo::Inherit::ISA = @ISA; # Access to overridden methods.

sub new {
my $type = shift;
--- 215,220 ----
***************
*** 225,239 ****
sub grr { print "grumble\n" }
sub goo {
my $self = shift;
! $self->Foo::Inherit::goo();
}
sub mumble {
my $self = shift;
! $self->Foo::Inherit::mumble();
}
sub google {
my $self = shift;
! $self->Foo::Inherit::google();
}

package main;
--- 223,237 ----
sub grr { print "grumble\n" }
sub goo {
my $self = shift;
! $self->SUPER::goo();
}
sub mumble {
my $self = shift;
! $self->SUPER::mumble();
}
sub google {
my $self = shift;
! $self->SUPER::google();
}

package main;