=over =item pop ARRAY X X =item pop Removes and returns the B element of the array, shortening the array by one element. my @arr = ('cat', 'dog', 'mouse'); my $item = pop(@arr); # 'mouse' # @arr is now ('cat', 'dog') Returns C if the array is empty. B C may also return C if the last element in the array is C. my @arr = ('one', 'two', undef); my $item = pop(@arr); # undef If ARRAY is omitted, C operates on the L|perlvar/@ARGV> array in the main program, but the L|perlvar/@_> array in subroutines. C will operate on the C<@ARGV> array in C, C, C, C blocks. Starting with Perl 5.14, an experimental feature allowed L|/pop ARRAY> to take a scalar expression. This experiment has been deemed unsuccessful, and was removed as of Perl 5.24. =back