Your @types arrays are getting flattened to lists in the declaration of your %changes hash, causing every other element in them to become a key. So your hash declaration really evaluates to my %changes = ( "2006_01_01_00_00_00" =>  'i', 'i', 'm', ... and so on.

(Since every item in your @types arrays is either 'i' or 'm', those keys keep clobbering themselves.) What you want is a hash of arrays, which you can make easily enough by taking a reference to the arrays:

my %changes = ( "2006_01_01_00_00_00" => \@types0, "2006_02_03_19_00_00" => \@types1, "2006_03_03_09_00_00" => \@types2, "2006_04_14_22_00_00" => \@types3, "2006_07_07_22_00_00" => \@types4, "2006_07_20_19_00_00" => \@types5, "2006_08_10_20_00_00" => \@types6, "2006_10_17_21_00_00" => \@types7, "2006_11_06_23_00_00" => \@types8, "2006_11_27_20_00_00" => \@types9, "2006_12_18_21_00_00" => \@types10, "2007_03_19_20_00_00" => \@types11, "2007_05_09_20_00_00" => \@types12, "2007_08_06_16_00_00" => \@types13, "2007_09_09_08_00_00" => \@types14, );

In reply to Re: strange hash thing going on by friedo
in thread strange hash thing going on by dpath2o

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.