title: Perl - Ordered multi-dimensional hash (use Hash::Ordered)
body: <p>I am attempting to walking through a multi-dimensional hash in Perl, in the exact order I created it.  I am using Hash::Ordered, but cannot get it to work.</p>
  <p>If I use Data::Dumper to print $MENU_ITEMS I see the hash elements I expect (see below), however, when I attempt to ingest them into $ITEM, it is blank.</p>
  <p>I am sure I am doing something stupid, kindly help :)</p>
  <pre><code>use Hash::Ordered;
  $MENU_SECTIONS = Hash::Ordered-&gt;new
      (
      'MENU_manage_properties' =&gt; 
          {
          'show_current_properties'  =&gt; 'Current Properties',
          'show_prospect_properties' =&gt; 'Prospect Properties'
          },
      'MENU_reports' =&gt; 
          {
          'some_report'             =&gt; 'Some report',
          'another_report'          =&gt; 'Another report'
          },
      'MENU_settings' =&gt; 
          {
          'settings_here'           =&gt; 'Settings',
          'more_settings'           =&gt; 'More Settings'
          }
      );
  
  %MENU_SECTIONS_HTML = ();
  
  use Data::Dumper;
  print header();
  
  $menu_iterator = $MENU_SECTIONS-&gt;iterator;
  while( (my $MENU_SECTION, my $MENU_ITEMS) = $menu_iterator-&gt;() ) 5
      {
      print &quot;&lt;hr&gt;my $MENU_SECTION, my $MENU_ITEMS&lt;br&gt;&quot;;
      print &quot;Dumper print of MENU_ITEMS:&lt;br&gt;&quot;;
      print Dumper $MENU_ITEMS;
      print &quot;&lt;br&gt;&lt;br&gt;&quot;;
  
      my $ITEM = Hash::Ordered-&gt;new(@MENU_ITEMS);
      $item_iterator = $ITEM-&gt;iterator;
      print &quot;Dumper print of ITEM:&lt;br&gt;&quot;;
      print Dumper $ITEM;
      print &quot;&lt;br&gt;&lt;br&gt;&quot;;
  
      print &quot;Dumper print of item_iterator:&lt;br&gt;&quot;;
      print Dumper $item_iterator;
      print &quot;&lt;br&gt;&lt;br&gt;&quot;;
  
      while( (my $OPERATION, my $TITLE) = $item_iterator-&gt;() ) 
          {
          print &quot;my $OPERATION, my $TITLE&lt;be&gt;&quot;;
          }
      }
  </code></pre>
  <p>Output I am getting:</p>
  <pre><code>my MENU_manage_properties, my HASH(0x43a21f0)
  Dumper print of MENU_ITEMS:
  $VAR1 = { 'show_current_properties' =&gt; 'Current Properties', 'show_prospect_properties' =&gt; 'Prospect Properties' };
  
  Dumper print of ITEM:
  $VAR1 = bless( [ {}, [], undef, 0, 0 ], 'Hash::Ordered' );
  
  Dumper print of item_iterator:
  $VAR1 = sub { &quot;DUMMY&quot; };
  
  my MENU_tenants, my HASH(0x4397b80)
  Dumper print of MENU_ITEMS:
  $VAR1 = { 'show_current_tenants' =&gt; 'Current Tenants', 'show_prospect_tenants' =&gt; 'Prospect Tenants' };
  
  Dumper print of ITEM:
  $VAR1 = bless( [ {}, [], undef, 0, 0 ], 'Hash::Ordered' );
  
  Dumper print of item_iterator:
  $VAR1 = sub { &quot;DUMMY&quot; };
  
  my MENU_buyers, my HASH(0x4317590)
  Dumper print of MENU_ITEMS:
  $VAR1 = { 'show_prospect_buyers' =&gt; 'Prospect Buyers', 'show_current_buyers' =&gt; 'Current Buyers' };
  
  Dumper print of ITEM:
  $VAR1 = bless( [ {}, [], undef, 0, 0 ], 'Hash::Ordered' );
  
  Dumper print of item_iterator:
  $VAR1 = sub { &quot;DUMMY&quot; };
  
  my MENU_reports, my HASH(0x43175f0)
  Dumper print of MENU_ITEMS:
  $VAR1 = { 'some_report' =&gt; 'Some report', 'another_report' =&gt; 'Another report' };
  
  Dumper print of ITEM:
  $VAR1 = bless( [ {}, [], undef, 0, 0 ], 'Hash::Ordered' );
  
  Dumper print of item_iterator:
  $VAR1 = sub { &quot;DUMMY&quot; };
  
  my MENU_settings, my HASH(0x4317650)
  Dumper print of MENU_ITEMS:
  $VAR1 = { 'more_settings' =&gt; 'More Settings', 'settings_here' =&gt; 'Settings' };
  
  Dumper print of ITEM:
  $VAR1 = bless( [ {}, [], undef, 0, 0 ], 'Hash::Ordered' );
  
  Dumper print of item_iterator:
  $VAR1 = sub { &quot;DUMMY&quot; }; 
  </code></pre>