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

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.

View
 

YamlPage

Page history last edited by David B 11 years, 8 months 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.