my $result = $cache{$input} ||= my_function($input);