This function treats an array like a stack - it pops
and returns the last value of the array, shortening the array by 1.
ARRAY is omitted, the function pops @ARGV (in the main program),
or @_ (in subroutines).
It has the same effect as:
$tmp = $ARRAY[$#ARRAY--];
$tmp = splice @ARRAY, -1;
Note that pop requires its first argument to be an array, not a list. If you just want the last element of a list, use this: