Odd number of elements in hash assignment at ...

Ever mindful of the ambiguity of "odd", I always laugh whenever I see this error. My mind drifts back to (circa) 1969 ... Deniliquin High School, Remedial Maths (Donald Firth, the presiding teacher):

Mr. Firth: Here's the problem. We have 18 horses, and 5 stalls ... we have to house those 18 horses in the 5 stalls in such a way that there is at least one horse in each stall, and there is an odd number of horses in each stall.

Young syphilis: Can't be done, Sir. We put one horse in each stall (to satisfy the first requirement) ... that leaves 13 horses to be accommodated. They have to be accommodated in multiples of 2 (to preserve the oddness). No matter how we do that there will always be an odd number of horses left over which, when assigned to a particular stall, will mean there's an even number of horses in that stall.

Mr. Firth: Not so, young syphilis, we merely put one horse in each of the first 4 stalls and 14 horses in the 5th stall.

Young syphilis: But Sir ... 14 is not an odd number !!

Mr. Firth: Au contraire, young syphilis ... "14" is a very odd number of horses to be housed in the one stall !!

Never argue with a Maths Teacher.

Cheers,
Rob

In reply to Re: Odd number of elements error by syphilis
in thread Odd number of elements error by Angharad

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.