pop

Synopsis

$ pop(@array)

Removes the last element from @array and returns it.

Parameters

@array - the array to "pop" a value from.

Returns

The scalar removed from the end of the specified array.

Side Effects / Notes

Examples

@stack = @("bottom", "middle", "top"); $top = pop(@stack); println($top); println("Stack is: " . @stack);

top Stack is: @('bottom', 'middle')

See Also