| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

YamlPage

Page history last edited by David B 15 years, 1 month ago

YAML is a way of putting complex data structures into an easy-to-read and easy-to-edit format.

 

#!/usr/bin/perl

use YAML;
use Data::Dumper;

$hash = {
  bar   => [ 'baz', 'qux', 'quux' ],
  corge => 'grault',
};
print YAML::Dump $hash;

$text = <<EOT;
one:
  - two
  - three
four: five
EOT

$href = YAML::Load $text;

print "=-" x 25, "n", Data::Dumper::Dumper($href);

 

Produces this output:

 

 

---
bar:
  - baz
  - qux
  - quux
corge: grault
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
$VAR1 = {
          'one' => [
                     'two',
                     'three'
                   ],
          'four' => 'five'
        };

Comments (0)

You don't have permission to comment on this page.