GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

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

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

    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

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
        # 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
        # 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
    

register
Called by YAML::PP::Schema
2021-12-25 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.