YAML::P...::IxHash(3)
π YAML::PP::Schema::Tie::IxHash π
okay bestie, this page is straight out of the User Contributed Perl Documentation β folding that manual name in right here so you know the vibe π. Buckle up, because this one is deprecated but still iconic for ordered-hash dumping.
πΈ NAME πΈ
YAML::PP::Schema::Tie::IxHash - (Deprecated) Schema for serializing ordered hashes
β¨ SYNOPSIS β¨
Here's the whole little ritual, no cap:
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 π
Okay so this is deprecated. Like, for real. See the new option preserve in YAML::PP π
.
This schema lets you dump ordered hashes that are tied to Tie::IxHash. It's giving ordered-hash realness and we love that for you β¨.
Also heads up: this code is pretty new and experimental π§ͺ.
Loading? not yet implemented for loading yet, so for now you have to tie the hashes yourself. No magical auto-tie, bestie π.
Examples:
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;
Then the YAML it gives you:
# YAML
---
U: 2
B: 52
c: 64
19: 84
Disco: 2000
Year: 2525
days_on_earth: 20000
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';
And the blessed YAML:
# YAML
--- !perl/hash:Order
U: 2
B: 52
c: 64
19: 84
Disco: 2000
Year: 2525
days_on_earth: 20000
π«Ά METHODS π«Ά
register
Called by YAML::PP::Schema
that's the whole page, bestie π source/version is perl v5.42.0, date is 2026-04-24, and the page is YAML::P...::IxHash(3) β now go tie those hashes with main character energy πβ¨.
π¦ where this page comes from
- opensuse-leap 16.0: perl-YAML-PP 0.40.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms