You are viewing the version of this documentation from Perl 5.005. View the latest version
pop ARRAY
pop

Pops and returns the last value of the array, shortening the array by 1. Has a similar effect to

$tmp = $ARRAY[$#ARRAY--];

If there are no elements in the array, returns the undefined value. If ARRAY is omitted, pops the @ARGV array in the main program, and the @_ array in subroutines, just like shift().