Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) Seed the random number generatorAppend one or more elements to ... (Berikutnya)
Functions for real @ARRAYs

Remove the last element from an array and return it

Daftar Isi

  • pop ARRAY

  • pop EXPR
  • pop

    Pops and returns the last value of the array, shortening the array byone element.

    Returns the undefined value if the array is empty, although this may alsohappen at other times. If ARRAY is omitted, pops the @ARGV array in themain program, but the @_ array in subroutines, just like shift.

    Starting with Perl 5.14, pop can take a scalar EXPR, which must hold areference to an unblessed array. The argument will be dereferencedautomatically. This aspect of pop is considered highly experimental.The exact behaviour may change in a future version of Perl.

    To avoid confusing would-be users of your code who are running earlierversions of Perl with mysterious syntax errors, put this sort of thing atthe top of your file to signal that your code will work only on Perls ofa recent vintage:

    1. use 5.014;# so push/pop/etc work on scalars (experimental)
 
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) Seed the random number generatorAppend one or more elements to ... (Berikutnya)