$dispatch{calculate_key{$input}}->(%attr); sub calculate_key { #.. return $key; }