On 6/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

What I'm having trouble understanding is how $class is passed the
argument "Horse" when I don't explicitly pass Horse as a parameter to
speak.

It's automatic when you use the method syntax. If you called a
subroutine in the normal way, perl would leave your argument list
alone. But when you make a method call, perl adds the class name (or
blessed object) as the first parameter.

   # Without method syntax, manually include the class name
   &Horse::speak("Horse");

   # With method syntax, perl adds it for you
   Horse->speak();

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

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


Reply via email to