You need to tie each inner hash (those keyed by "alice", "andy", and "john"):
use Tie::IxHash; use strict; my $HoHoH = {}; tie %{$HoHoH->{$_}}, 'Tie::IxHash' foreach qw(alice john andy); + # rest of code as above # output: alice aaaa time = 20:00:00 www time = 22:00:00 bbb time = 25:00:00 andy xxx time = 24:00:00 yyy time = 26:00:00 john ccc time = 21:00:00 aaa time = 23:00:00
Also, I suggest that you use strict;, as your original code had the following (lines three and four) which refer to different variables:
# global %HoHoH tie %{$HoHoH{text}}, 'Tie::IxHash'; # lexical $HoHoH (reference) my $HoHoH = {};
strict will catch this at compile time:
Global symbol "%HoHoH" requires explicit package name at /tmp/1.pl lin +e 4.
Your code ties a different variable than you were using everywhere else in your code. In addition, the key "text" that points to the inner hash stored in your global hash %HoHoH isn't used anywhere else.

Hope this helps.

--sacked

In reply to Re: HoHoH Insertion Order by sacked
in thread HoHoH Insertion Order by Anonymous Monk

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.