in reply to Howto avoid large hard-coded else-if function calls

Use a dispatch table to map your categories (A .. E) to functions and look for you category in $func_com.

Something like...

my %dispatcher = ( A => \&func_A, B => \&func_B, C => \&func_C, #etc ); my @temp_results; for my $cat ( 'A' .. 'E' ) { push @temp_results, [ $dispatcher{$cat}->( @some_val ) ] if $func_com =~ m/$cat/; # index is better } push @all_res, \@temp_results; # Do something with @all_res