use strict; use warnings; my $SubroutName='test'; my %SubroutDispatch = ( test => \&test, test1 => \&test1, test2 => \&test2, ); my $text='abcdefgijkl'; my $sub = $SubroutDispatch{$SubroutName}; &$sub($text); sub test { print "\nokey $_[0]!"; } sub test1{ print "\nokey!"; } sub test2{ print "\nokey!"; }