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.