In computing, especially in stack architectures, push means adding an element to the "top" of the stack. Push is the opposite of pop, which removes and returns the "top" element from the stack.

Example:
Stack: ->ABC
push D
Stack: ->ABCD
pop
(returns D)
Stack: ->ABC
pop
(returns C)
Stack: ->AB


Perl function:
push @array, list

Returns new length of @array.

Push adds list to the end of @array. @arrays length is increased by the length of list.

See also pop, shift and unshift.

Back to Perl