in reply to Question on use of Super with OO programing
If you look at your first example, you see that $self is set to the result of the shift function. shift returns the first value in an array (and removes it from the array), when it has no arguments it returns the first value from @_, which is also where you find the arguments of a sub.package Bird; use Dragonfly; { package Dragonfly; sub divebomb { shift->SUPER::divebomb(@_)} }
C.
PS: Your examples are a bit mixed up, $self->Donkey::speak(@_) is part of a third example in the middle of that page:
sub speak { my $self = shift; print "The mule speaks!\n"; $self->Donkey::speak(@_); }
|
|---|