On Sep 16, 2005, at 4:38 PM, David Ljung Madison (via RT) wrote:
The return value for push is the total number of elements in the array. According to the docs, push: "Returns the new number of elements in the array."
Right -- the new number of elements, as opposed to the number of new elements.
Example code: my @j = (1..100); print push(@j,42), "\n"; Should display 1, but it displays 101.
My reading of the docs you quoted is consistent with the exhibited behavior. The old number of elements is 100 and the new number of elements is 101.
Josh