Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Comment on

( #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

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    Discipulus definitevely shutted down a 12yo server

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (8)
    As of 2017-07-25 11:24 GMT
    Find Nodes?
      Voting Booth?
      I came, I saw, I ...

      Results (370 votes). Check out past polls.