Those examples are exactly equivalent. In general the only problem with these automatically quoted strings is that they need to be valid identifiers or integral numbers not starting with 0 (more or less matching
/^([1-9]\d*)|([a-zA-Z_]\w*)$/).
update: as demonstrated by ikegami below, actually only valid identifiers are quoted: that means anything matching /^[a-zA-Z_]\w*$/ but not numbers.
As long as you use valid keys, and don't use version strings (/^v\d+$/) the quoted and unquoted keys are equivalent.
The version strings implementation makes $hash{v80} != $hash{'v80'} etc. in some versions of perl, so for portability these keys should always be quoted.
So, in short, if you don't want to think about the keys you use, quote them, but usually an intuitive key name can be used unquoted.
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.