我想使用 Perl 从哈希映射中删除与给定数组中的值匹配的键。
例子:
输入:
@array = ("apple", "banana" , "cherry")
%hash = ( '/abc/apple/somestring' => val1,
'/banana/somestring/somesting' => val2,
'/xyz/apple/somestring' => val3,
'/somestring/somestring/' => val4,
'/xyz/somestring/random' => val2,
)
输出:
%hash = ( '/somestring/somestring/' => val4,
'/xyz/somesting/random' => val2,
)