The delete keyword edit
The delete command deletes a slice of a hash, if an EXPRESSION is given that specifies elements of a hash. After deletion, exists() no more returns true for this element/these elements. Setting a hash element to undef does not remove its key, but the delete command does.
If it is called in list context, it returns the value(s) deleted. The returned list's length is equal to the original one with undefs in place of the deleted items. If called in scalar context, the last deleted value is returned.
delete can also be used for arrays and array slices with a less straightforward behaviour. In this case, although exists() returns also false for deleted items, their indices will never change. To make the indices change, shift()() or splice() has to be used.
WARNING: Calling delete on array values is deprecated and will probably be removed in a future version.