What an honor. It was partly reading your book a couple of years ago, which got me this far. Not that you are to blame, mind you.
Its true, I think I've gotten this to work both with and without the double quotes.
'db' will never be a key, although db_host_name, db_database, db_user and db_pw are defined.
But $config{$key} is merely my work-around. My goal here is to consolidate and better organize my config hash so I can pass shorter argument lists to my subroutines. My subroutine calls have been getting quite unwieldy as this app has grown from its first deployed working version (at a few hundred lines) to its now comparatively more complex (but more feature-full) several thousand lines.
And it is that transition which is throwing up these errors. What does it mean to "use string . . . as a HASH ref". I thought hash keys had to be scalars (i.e. strings). And I thought I had to specifically pass a hash reference (i.e. \%config) and then dereference it on the other side ($$config{db}{$key}) to have to face _references_. So I'm quite confused as to what to do about this. Perhaps I fell asleep on the chapter which explained this all to me. I don't know. Any insight appreciated.
-- Hugh
In reply to Re^2: more fun w/ HASh ref's
by hesco
in thread more fun w/ HASh ref's
by hesco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |