我想知道如何在Perl中取消定义散列键的值.有人可以请更正我的代码吗?
#!/usr/bin/perl
use strict;
use warnings;
my %hash;
undef($hash{"a"});
undef($hash{"b"});
print scalar values %hash; # i need here 0
print scalar keys %hash; # and here 2
Run Code Online (Sandbox Code Playgroud)