Let's take for example the following array.
@fruit = qw(banana apple orange grapes);
Printing the array will print all of the values in the array.
banana apple orange grapes
Pop can be used to remove values from the end of the array. In this example, "grapes" is removed from the @fruit array.
pop @fruit;
Printing the array will show that "grapes" has been removed from the array.
banana apple orange
If needed, you can store the items being removed from the array in a variable.
$grapes = pop @fruit;
Shift can be used to remove values from the beginning of an array.
Unshift can be used to append values to the beginning of an array.
Push can be used to append vaues to the end of an array.