I've tried \s*, \S* and \ * in string substitutions in an effort to lose that trailing space. I have now intoduced a line which reads:
print STDERR "|$host|, |$db|, |$user|, |$pw|";
to determine where that space might be introduced. In Main::, when I define $db as $config{'db_name'}, I get the right value in the log. When I define $db as $config{'db}{'db_name'}, it throws the HASH ref error (as a Fatals to Browser message) and bombs out before it gets to my print STDERR debug statement.
As you can see from the code I posted at http://perlmonks.org/?node_id=511957, my supporters_conf.pm module includes a while <DB> block which includes:
So I'm thinking this has something to do with the $config{'db'}{'db_name'} piece and not with the value assigned to this hash element.my ($key, $val) = split(/\s*=\s*/,$_,2); $key =~ s/^\s*//; $val =~ s/ *$//g; # also tried \s* and \S*, as well $config{'db'}{"$key"} = $val; $config{"$key"} = $val;
-- Hugh
In reply to Re^7: more fun w/ HASh ref's
by hesco
in thread more fun w/ HASh ref's
by hesco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |