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
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, details, 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, summary, 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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.