in reply to Re^2: Can't use string ("") as a HASH ref while "strict refs"
in thread Can't use string ("") as a HASH ref while "strict refs"

$config{'db'}{'$key'} = $val;
should be
$config{'db'}{$key} = $val;
but I don't think that will fix your error. The error seems to indicate that $config{'db'} was assigned '' or undef. Are you sure both %config are the same variable?

Replies are listed 'Best First'.
Re^4: Can't use string ("") as a HASH ref while "strict refs"
by hesco (Deacon) on Nov 26, 2005 at 05:08 UTC
    You wrote: Are you sure both %config are the same variable? Both %config and what? are the same variable?

      The %config in the first snippet and %config in the second snippet.

      • Maybe they are both package (our) variables, but in different packages.
      • Maybe one is a package (our) variable, and the other is a lexical (my) variable.
      • Maybe they are both lexical (my) variables, but different lexical varibbles (i.e. in different scopes). [There's an our in one of the snippets.]
A reply falls below the community's threshold of quality. You may see it by logging in.