Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Keeping Order with YAML::XS (impossible, try YAML::Tiny, because no yamltidy)

by Anonymous Monk
on Jul 29, 2013 at 04:01 UTC ( [id://1046763]=note: print w/replies, xml ) Need Help??


in reply to Keeping Order with YAML::XS

FWWIAFAIR, YAML::Tiny produces that type of output, I thought maybe if married with Tie::IxHash it will preserve order? But looks like not

use YAML::Tiny qw/ Dump /; use Tie::IxHash; tie my(%hash), 'Tie::IxHash'; %hash = ( 'path' => '/export/home/frank', 'options' => [ { 'value' => '1001', 'param' => 'i' }, { 'param' => 'f' }, { 'value' => 'eyes', 'param' => 'x' }, {}, { 'value' => 'toes', 'param' => 'b' }, { 'param' => 'p' }, ], 'arguments' => [ { 'value' => 'test' } ], ); print Dump(\%hash); __END__ --- arguments: - value: test options: - param: i value: 1001 - param: f - param: x value: eyes - {} - param: b value: toes - param: p path: '/export/home/frank'

This is what I don't like about YAML, no yamltidy

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1046763]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-03-29 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found