in reply to How can I assign the elements in an array to only the key values in a hash?

Least confusing and most idiomatic is
@hash{@keys} = ();
Unlike arturo's code, it writes a list where it means to write a list. See MeowChow's comments; here all values get set to undef "implicitly".
  • Comment on Re: How can I assign the elements in an array to only the key values in a hash?
  • Download Code