Hi,
  don't know much about oo in perl, but a "regular" sub:
>From man perlsub:
[...]
All functions aree passead as parameters one single flat list os
scalars.
[...]
Any arguments passed in show up in the array '@_'.Therefor, if you
called a function with two arguments, those would be stored in '$_[0]
and $_[1].

Hope it helps,

Duarte


-----Original Message-----
From: montana [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, October 15, 2002 10:41 PM
To: [EMAIL PROTECTED]
Subject: Newbie Question.


I've been looking through the manual perlboot. This is a beginners
tutorial on Perl OOP.


One of the practice programs in this manual had the following line: my
$class = shift;

This was located in the subroutine:
sub Sheep::speak {...}

>From what I've gathered so far, "my" makes the variable "$class" local
to the subroutine only? Is this correct? "shift" takes the leftmost
value out of a list and places it in the variable $class? Is this
correct? If I got all of this correct, where is the array that shift is
working on and why use shift instead of pop? Also what are the contents
of this array and how can I see them? I know that that line of code
places the value "Sheep" into "$class", I was just wondering how this
works in plain English? I'm guessing, and please correct me if I'm wrong
here, the array is "@_"? And this array contains the current class name
"Sheep" as it's only item? And this is why "shift" and "pop" produce the
same results?

Thanks in advance.
SA

"I can do everything on my Mac that I used to do on my PC, plus alot
more ..." --Me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


________________________________________________________________________
____
For your protection, this e-mail message has been scanned for viruses.
Visit us at http://www.neoris.com/

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to