2
如果值滿足一定的條件,我試圖打印出哈希鍵。但是,如果滿足值條件,我不確定如何訪問散列鍵。這是我的代碼:在foreach循環中用Perl中的值打印出相關的鍵
foreach my $x (values %hash){
if ($x > $ARGV[1]){
$counter = $counter + 1
print "keys %hash\n"
}
}
print "$counter\n"