http://www.perlmonks.org?node_id=438291


in reply to hash slice

Page 37 gives an example of a hash slice. The important concept to note is that the sigil (the symbol in front of a variable name, like $, @, or %) connotes what kind of value is being retrieved, not what kind of variable is being accessed.

The shape of the braces indicate that @hsh{@ary} is a slice of a hash, rather than a slice of an array, which would be @hsh[@ary].

Applying undef to a hash slice relies on undocumented behavior, but the intent is to get all those keys to exist in the hash. A better technique is

@hsh{@ary} = ();

Caution: Contents may have been coded under pressure.