note
Perlbotics
<p>
You need to populate the hash with code-references (\&sub).
</p>
Try:
<p>
<code>
use strict;
# my $code_ref = {'SUM', 'sum'};
my $code_ref = {'SUM', \&sum};
sub sum($$){...} # do you really need ($$) ? That is rarely useful.
# ($codes->{'SUM'})->(4,5); # $codes? You mean $code_ref?
$code_ref->{'SUM'}->(4,5);
</code>
</p>
1000196
1000196