The behavior is similar to that on hash elements.
exists() can be used to check whether an array element has been
-initialized without autovivifying it. If the array is tied, the
-EXISTS() method in the corresponding tied package will be invoked.
+initialized. This avoids autovivifying array elements that don't exist.
+If the array is tied, the EXISTS() method in the corresponding tied
+package will be invoked.
delete() may be used to remove an element from the array and return
it. The array element at that position returns to its unintialized
state, so that testing for the same element with exists() will return
false. If the element happens to be the one at the end, the size of
-the array also shrinks by one. If the array is tied, the DELETE() method
-in the corresponding tied package will be invoked.
+the array also shrinks up to the highest element that tests true for
+exists(), or 0 if none such is found. If the array is tied, the DELETE()
+method in the corresponding tied package will be invoked.
See L<perlfunc/exists> and L<perlfunc/delete> for examples.
Given an expression that specifies a hash element, array element, hash slice,
or array slice, deletes the specified element(s) from the hash or array.
-If the array elements happen to be at the end of the array, the size
-of the array will shrink by that number of elements.
+In the case of an array, if the array elements happen to be at the end,
+the size of the array will shrink to the highest element that tests
+true for exists() (or 0 if no such element exists).
Returns each element so deleted or the undefined value if there was no such
element. Deleting from C<$ENV{}> modifies the environment. Deleting from
Deleting an array element effectively returns that position of the array
to its initial, uninitialized state. Subsequently testing for the same
-element with exists() will return false. See L</exists>.
+element with exists() will return false. Note that deleting array
+elements in the middle of an array will not shift the index of the ones
+after them down--use splice() for that. See L</exists>.
The following (inefficiently) deletes all the values of %HASH and @ARRAY: