Perl delete Function

Advertisements


Description

This function deletes the specified keys and associated values from a hash, or the specified elements from an array. The operation works on individual elements or slices.

Syntax

Following is the simple syntax for this function:

delete LIST

Return Value

This function returns undef if the key does not exist and value associated with the deleted hash key or array index.

Example

Following is the example code showing its basic usage, it deletes all the values of %HASH and @ARRAY:


When above code is executed, it produced following result:




Advertisements
Advertisements