Is it doable?
Yes, of course. How would you do it? Do you have some thoughts about how this might be done? Code?
I think that this tasks amounts to having config values treated as macros. A distinction between literal values, macros and referenced YAML keys has to be established. Macro values would be turned into an anonymous subs, so retrieving a value would be done like this (shown here with a hash):
my $val = ref $yaml{$key} eq 'CODE' ? $yaml{$key}->() : $yaml{$key};
or the like. You'd be inventing a macro language for your config files. The node tied hash for data munging is based on that. You should be very careful if you are going to shell out to get a value, since typos or mischief can be disastrous. Always run such code under -T (taint checks - see perlrun)!
In reply to Re:yaml dynamically load in perl
by shmem
in thread yaml dynamically load in perl
by louie_45
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |