in reply to array pushing
Ok - you completely missed the part that says same effect as. The syntax for push is (see top line of documentation):push ARRAY,LIST Treats ARRAY as a stack, and pushes the values of LIST onto the end of + ARRAY. The length of ARRAY increases by the length of LIST. Has the +same effect as for $value (LIST) { $ARRAY[++$#ARRAY] = $value; } but is more efficient. Returns the new number of elements in the array +.
The blurb from the documentation is saying that push treats the array like a stack. Imagine one of those bad cafeteria's that have the plates on a spring loaded stack. You push a new plate onto the stack it gets bigger, you pop one off by pulling the top plate off.push @array , "new value";
This example of code is doing the following:
That is the same thing as pushing a new plate on the stack.
I hope this helps - L~R
|
|---|