use strict; use warnings; my %op = ( 'toupper' => \*uc{CODE}, #... ); print( $op{toupper}->('foo'), "\n" ); #### Name "main::uc" used only once: possible typo at a.pl line 5. Not a CODE reference at a.pl line 10.