# $name is somehow derived from the object value we're storing. The # details of that are (probably) unimportant. $name = $key_obj->derive_name($obj); # insert to cache: $cache{$name} = $obj->value(); # insert to cache with possible collision: $cache{$key_obj->object_ID() . $name} = $obj->value(); # remove from cache: $value = $cache{$name}; # remove from cache with possible collision: $value = $cache{$key_obj->object_ID() . $name};