On 2/7/2004 1:23 PM, James Edward Gray II wrote:

On Feb 7, 2004, at 10:02 AM, Jeff 'japhy' Pinyan wrote:

On Feb 7, Jan Eden said:

{   package Mouse
   @ISA = qw{Animal};
   ...
   sub speak {
   my $class = shift;
    ...
    Animal::speak($class);
    ...
    }
}


I was about to ask why it's written this way, but upon checking the
source, I see that this is the way the first example on overriding a
method looks.


I was going to ask this too. I'm glad I finished reading the email.

I'm not familiar with the book though, so I will ask this? Does it eventually go on to introduce SUPER::? That's what I would prefer here and I just want to make sure you're aware of the option.

Hmm, I think a good exercise would be to write code snippets to demonstrate the differences between the four method calls:


Package::method()
$class->method()
$class->Package::method()
$class->SUPER::method()

or five if you count:

method Package ...



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to