In my opinion, the first code example is unnecssarily complicated – notice that it “sent you to Camel book, to no avail.” It all comes down to this, and could have been stated in just this way: %fields = { id => 0, name => 1, age => 2};

It all comes down to, the information the OP already provided?

How can you be confused about what the OP knows when you're actively copy/pasting what he knows?

Calling a hash slice "unnecssarily complicated" is very silly and very telling

because future bug-sleuths will naturally tend to read the human comment and not verify that the code in fact matches it.)

Thats what non-programmers naturally do because they can't read code

Programmers would ignore the comments and read the code


In reply to Re^2: Help me understand this idiomatic hash from array code by Anonymous Monk
in thread Help me understand this idiomatic hash from array code by adhrain

Title:
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, 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:
    & &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.