in reply to Re: Keeping Order with YAML::XS
in thread Keeping Order with YAML::XS
Here's the Perl code:path: /export/home/frank options: - param: i value: 1001 - param: f - param: x value: eyes arguments: - value: test
And here's the output yaml (out.yaml) that it creates:#!/usr/bin/env perl use strict; use warnings; use YAML::XS qw(LoadFile DumpFile); use Data::Dumper; my $data = LoadFile('test.yaml'); print Dumper($data); DumpFile('out.yaml', $data);
Notice that in the input file the syntax was in such a way that it was an ordered sequence (from what I am understanding of YAML anyway). Yet, in the output it is no longer ordered at all. I am trying to figure out from a Perl data structure how to make an ordered YAML file like what is the input.--- arguments: - value: test options: - param: i value: 1001 - param: f - param: x value: eyes path: /export/home/frank
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Keeping Order with YAML::XS
by Loops (Curate) on Jul 29, 2013 at 06:20 UTC | |
by walkingthecow (Friar) on Jul 29, 2013 at 08:08 UTC | |
by Corion (Patriarch) on Jul 29, 2013 at 08:10 UTC | |
by Loops (Curate) on Jul 29, 2013 at 09:40 UTC | |
by Anonymous Monk on Jul 29, 2013 at 09:44 UTC | |
by Loops (Curate) on Jul 29, 2013 at 09:57 UTC | |
|