#!/usr/bin/env perl # Subhash order maintained use strict; use warnings; use Test::More tests => 3; use Tie::IxHash; tie my %a, 'Tie::IxHash'; tie my %b, 'Tie::IxHash'; tie my %x, 'Tie::IxHash'; my %foo; $a{c} = [3, 2, 1]; %x = ( s => 'senatus', p => 'populus', q => 'que', r => 'romanus'); %b = ( x => \%x, y => "ravi" ); $a{b} = \%b; $foo{a} = \%a; is_deeply ([keys %{$foo{a}}], [qw/c b/], '1st level order retained'); is_deeply ([keys %{$foo{a}{b}}], [qw/x y/], '2nd level order retained'); is_deeply ([keys %{$foo{a}{b}{x}}], [qw/s p q r/], '3rd level order retained');