my %table = map { $_ => \&{'func_'.$_} } 'A'..'E'; for (split //, $func_com) { push @all_res, [ $table{$_}->(@some_val) ]; }