[Chapter 3] 3.2.143 shift
Author: Larry Wall, Tom Christiansen & Randal L. Schwartz
Date: 1999-07-02T01:53:59Z

#

| Chapter 3 Functions |

### 3.2.143 shift

    shift ARRAY
    shift

This function shifts the first value of the array off and returns it, shortening the array by 1 and moving everything down. (Or up, or left, depending on how you visualize the array list.) If there are no elements in the array, the function returns the undefined value. If `ARRAY` is omitted, the function shifts @ARGV (in the main program), or @_ (in subroutines). See also unshift, push, pop, and splice. The shift and unshift functions do the same thing to the left end of an array that pop and push do to the right end.

3.2.142 setsockopt |  | 3.2.144 shmctl