in reply to Re: Balancing Complexities of Data Structures, Code and Readability
in thread Balancing Complexities of Data Structures, Code and Readability

I agree with most of the above comments, and in particular, I would also stress how important it is to have "constant" data outside of your function.

Additionally, eliminating duplication is also a priority, though not at the expense of needless complexity. In this case, @SYS is really the same as keys %POvars, so there is no need for this extra definition.

Further along those lines, I would restructure your definition something like:
my @POvars_common = qw[ ppo userid email ]; my %POvars = ( 'GRP' => [@POvars_common, 'gwpo', 'gwdomain'], 'JAG' => [@POvars_common, 'jagexcept'], 'CIS' => [@POvars_common], 'MST' => [@POvars_common], 'GCG' => [@POvars_common] );
Although this doesn't seem like a big deal, removal of duplication can help with: