How do I remove the key from an existing map?
if (exists $sampleMap{1})
{
#Here I want to remove the "1" key from sampleMap
}
Use delete
for deleting the hash keys:
if (exists $sampleMap{1})
{
delete $sampleMap{1}; #Here I want remove the "1" key from sampleMap.
}
For more details, take a look at delete.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With