my $x = "variable_name"; my $value = "value"; eval "\$$x = $value"; warn $@ if $@; print $color1; #### my %config; # use database (DBI) to read key / values into hash # ... $config{color1} = "red"; print $config{color1};