http://www.perlmonks.org?node_id=946692


in reply to How to map function name to coderef?

... what I would really like is to map a string to the code reference of the function itself ...

If you mean an arbitrary string, the following is one way.

>perl -wMstrict -le "my %f_map = ( glue => \&foo, ); ;; print $f_map{glue}->('hoo'); ;; sub foo { return 'FOO' . $_[0]; } " FOOhoo