YAML::PP::Schema::Tie::IxHash(3) User Contributed Perl Documentation YAML::PP::Schema::Tie::IxHash(3)

# [NAME](#NAME)

YAML::PP::Schema::Tie::IxHash - (Deprecated) Schema for serializing ordered hashes

# [SYNOPSIS](#SYNOPSIS)

```
    use YAML::PP;
    use Tie::IxHash;
    my $yp = YAML::PP->new( schema => [qw/ + Tie::IxHash /] );
    tie(my %ordered, 'Tie::IxHash');
    %ordered = (
        U => 2,
        B => 52,
    );
    my $yaml = $yp->dump_string(\%ordered);
    # Output:
    ---
    U: 2
    B: 52
```

# [DESCRIPTION](#DESCRIPTION)

This is deprecated. See the new option "preserve" in YAML::PP.

This schema allows you to dump ordered hashes which are tied to Tie::IxHash.

This code is pretty new and experimental.

It is not yet implemented for loading yet, so for now you have to tie the hashes yourself.

Examples:

[order](#order)

```
        # Code
        tie(my %order, 'Tie::IxHash');
        %order = (
            U => 2,
            B => 52,
            c => 64,
            19 => 84,
            Disco => 2000,
            Year => 2525,
            days_on_earth => 20_000,
        );
        \%order;
        # YAML
        ---
        U: 2
        B: 52
        c: 64
        19: 84
        Disco: 2000
        Year: 2525
        days_on_earth: 20000
    
```

[order\_blessed](#order_blessed)

```
        # Code
        tie(my %order, 'Tie::IxHash');
        %order = (
            U => 2,
            B => 52,
            c => 64,
            19 => 84,
            Disco => 2000,
            Year => 2525,
            days_on_earth => 20_000,
        );
        bless \%order, 'Order';
        # YAML
        --- !perl/hash:Order
        U: 2
        B: 52
        c: 64
        19: 84
        Disco: 2000
        Year: 2525
        days_on_earth: 20000
    
```

# [METHODS](#METHODS)

[register](#register)

Called by YAML::PP::Schema

2026-10-13 perl v5.44.0

---

Document: YAML::PP::Schema::Tie::IxHash(3pm) from perl-yaml-pp 0.43.0-r0 (Chainguard OS)
Source: https://github.com/perlpunk/YAML-PP-p5.git
