Name

pop

Synopsis

pop @array
                  

Treats an array like a stack, popping and returning the last value of the array and shortening the array by one element. If array is omitted, the function pops @ARGV (in the main program) or @_ (in subroutines).

If there are no elements in the array, pop returns the undefined value. See also push and shift . If you want to pop more than one element, use splice.

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.