use strict; use warnings; my %op = ( 'toupper' => \*uc{CODE}, #... ); print( $op{toupper}->('foo'), "\n" );