Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Do you have any coding superstitions?

I just was about to type $g->{'KeyWords'} and I thought, "this is crazy". Because I *know* I don't need the quotes. But somewhere at the back of my psyche is a half-remembered piece of advice, perhaps from my own anxiety-gland, that it's always a good idea to "get into the habit" in case I should ever have a key with whitespace in it.

Forget that I've never used, and never would use, a hash key with whitespace. All my Perl life I've been using quotes in hash keys. And it's become something I *have* to do... like you went through a phase of not stepping on the cracks between paving stones? Or *always* stepping on the cracks? I keep doing it, knowing that it's pointless, but being irrationally loth to stop.

Well, Perlmonks must stand for casting light into the irrational corners of our code, and so I take this opportunity (A) to renounce my superstition and (B) offer a space for other monks similarly afflicted to come into the light of day.

I, George_Sherston hereby renounce my obsessive urge to place quotes around hash keys even when they don't have whitespace.

§ George Sherston

In reply to Coding superstitions by George_Sherston

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 avoiding work at the Monastery: (4)
As of 2024-03-28 21:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found