Difference in ‘delete’ and ‘undef’ with %arrays?

Asked By 0 points N/A Posted on -
qa-featured

I want to know how much entry in associate array. Is there any difference in ‘delete’ and ‘undef’ with %arrays? Will the backticks work as they are doing in shells?

SHARE
Answered By 5 points N/A #157242

Difference in ‘delete’ and ‘undef’ with %arrays?

qa-featured

When you use the delete function in an array, then it will remove a key-value pair from a hash, but you may also choose to delete only an individual element of the hash function or a hash slice. When used in a list, what the delete function will do is return that contains the values that have been deleted, and in the scalar context it will be able to return the value that corresponds to the last element that was deleted.

The undef function on the other hand will be used when you need to replace an element of a particular index as opposed to the delete function that will remove the element.

-Experttechyv

 

Related Questions