A late answer, but yes, you can do that in perl with YAML::PP::Include (disclaimer: I'm the author)
# /path/to/file.yaml
# ---
# included: !include include/file2.yaml
# /path/to/include/file2.yaml
# ---
# a: b
use YAML::PP::Schema::Include;
my $include = YAML::PP::Schema::Include->new;
my $yp = YAML::PP->new( schema => ['Core', $include] );
$include->yp($yp);
my ($data) = $yp->load_file("/path/to/file.yaml");
# The result will be:
$data = {
included => { a => 'b' }
};
Also if you type in yaml include
in metacpan you should get this module as a result: https://metacpan.org/search?size=20&q=yaml+include
Note that !include
is not an official YAML tag, but any YAML library can choose to implement such a tag.