1
如何從現有地圖中刪除密鑰?對於如何從Perl中刪除哈希鍵?
if (exists $sampleMap{1})
{
#Here I want to remove the "1" key from sampleMap
}
如何從現有地圖中刪除密鑰?對於如何從Perl中刪除哈希鍵?
if (exists $sampleMap{1})
{
#Here I want to remove the "1" key from sampleMap
}
使用delete
刪除哈希鍵:
if (exists $sampleMap{1})
{
delete $sampleMap{1}; #Here I want remove the "1" key from sampleMap.
}
有關詳細信息,看看delete。