# $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}; #### # The name is keyed to the object we're using so if we have two different # types of objects with the same ID, we can differentiate. # insert to cache: $cache->insert(tag => ref $key_obj . $key_obj->object_ID(), data => $obj->value()); # remove from cache: @values = $cache->retrieve(tag => ref $key_obj . $key_obj->object_ID());