Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Mr. Schwartz:

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-16 22:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found