[1] pop takes out the elements from the right end of the array while shift does that from the left end. [2]When there is one element then the above mentioned functions will give you the same result :) [3] Yes, your notion about "my" is correct but for more information go through the man pages on www.perldoc.com or your system. [4] Here @_ is the array (you are right about that also). In this case you don't have to mention the name of the array.
Regards Dharmender Rai --- montana <[EMAIL PROTECTED]> wrote: > 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] > __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]