NAME
Developer::Dashboard::EnvInclude - pull one skill's env files into the current environment, namespaced
SYNOPSIS
use Developer::Dashboard::EnvInclude;
Developer::Dashboard::EnvInclude->include('foo.bar');
Developer::Dashboard::EnvInclude->include('foo.bar.*');
DESCRIPTION
Resolves a dotted skill path (foo.bar for a nested sub-skill bar under top-level skill foo) against every installed DD-OOP-LAYER, loads that skill's .env and .env.pl files in isolation, and merges only the resulting new or changed keys into the real process environment under a namespaced key: the dotted path uppercased with single underscores joining its own segments, then a double underscore, then the original variable name (foo.bar's BOB=1 becomes $FOO_BAR__BOB). A trailing .* segment additionally includes every nested sub-skill beneath the named skill, recursively.
This is the engine behind two callers: the # include <foo.bar> comment directive Developer::Dashboard::EnvLoader recognizes in plain .env files, and the env->include(...) method .env.pl files can call directly after use Developer::Dashboard; (see the env package in lib/Developer/Dashboard.pm).
PURPOSE
This module resolves and loads one named skill's environment files on demand, independent of the normal ancestor-directory env-layer chain, so a .env/.env.pl file can deliberately pull in another skill's variables under a namespaced key.
WHY IT EXISTS
The normal layered env loading only ever walks ancestor directories toward the current working directory. This module exists for the opposite case: reaching sideways or across the tree to a specific named skill by its dotted path, on request, with the result kept clearly namespaced so it can never silently collide with the including file's own variables.
WHEN TO USE
Use this when a .env or .env.pl file needs another skill's configuration values available under a predictable, namespaced key, rather than relying on that skill happening to be an ancestor directory in the normal load chain.
HOW TO USE
From a plain .env file, write # include <foo.bar> (or # include <foo.bar.*> to also pull in every sub-skill beneath it) on its own line. From a .env.pl file, call env->include('foo.bar') after use Developer::Dashboard;.
WHAT USES IT
Developer::Dashboard::EnvLoader (the .env comment-directive path) and the env package in lib/Developer/Dashboard.pm (the .env.pl programmatic path).
EXAMPLES
Example 1:
Developer::Dashboard::EnvInclude->include('foo.bar');
Loads skill foo's nested bar sub-skill's .env/.env.pl across every DD-OOP-LAYER that has it installed, namespacing every resulting variable as FOO_BAR__<name>.
Example 2:
Developer::Dashboard::EnvInclude->include('foo.bar.*');
Same as above, plus every sub-skill nested beneath foo.bar, each namespaced under its own deeper dotted path.