use Tie::IxHash; tie %hash_ref, 'Tie::IxHash'; %hash_ref = ( 'MAIN' => ixhash( 'ZOP' => ixhash( 'Dev', undef, 'Con', undef, 'Test', undef, 'Exit', undef, 'New', undef ), 'AP' => ixhash( 'Dev', undef, 'Con', undef, 'Test', undef, 'Exit', undef, 'New', undef ), 'Exit' => undef, ) );