my %funcs = ('A'=>\&func_a, 'ABC'=>\&func_c); #etc #... #and then call it as push @res, $funcs{$func_com}->(@someval);