in reply to Construct a data structure from a string
use strict; use Data::Dumper; use YAML; my $ref = Load(<<'XXX'); --- foo: - ~ - bar: baz: - 123 XXX print Dumper($ref); [download]