in reply to Re: dynamically creating variables
in thread dynamically creating variables

Incidently, you're getting that error because you are trying to dereference a string (${$config} becomes ${ 'db' }, not the variable $db).

Well, if $config contains the string db, ${$config} is a variable $db. It's not a lexical variable, but a package variable. Still, addressing it with $db works just fine (provided there isn't a lexical $db in the current scope).

my $config = 'db'; ${$config} = 'foo'; print $db, "\n"; __END__ foo