YAML::Object

YAML::Object reads YAML-files and lets you point to the nodes, using object-orientation.

Source

Documentation

YAML

foo:
  bar: 123

  ## comment
  bah:
   - node1
   - node2
   - node3

Perl code

### create object
my $cfg = YAML::Object->LOAD('path/to/my.yaml');

### merge path/to/another/file.yaml with existing config-file
$cfg->LOAD('path/to/another/file.yaml');

$value = $cfg->foo->bar;       # "123"
@hash  = %{ $cfg->foo };       # (bar => "123", bah => [...])
@array = @{ $cfg->foo->bah };  # ("node1", "node2", "node3")
$value = $cfg->foo->bah->[1];  # "node2"