my $config= 'A' eq $test ? \%config_A : \%config_B; #### my %config= ( A => \%config_A, B => \%config_B, ); my $config= $config{ $test } or die "Unknown test '$test'";