Skip to main content






Is there a way to directly include a variable declared in a dumped config file in one of my scripts? The structure of the file is below:

{ my $variable = { “key1” => { “key2” => { “key3” => “value1”, }, }, }; }

1;

As you can see, the variable declares a deeply nested hash_ref which I don’t want to have to parse manually. I also don’t have any control over the dumped variable file, the design flow I am working in dumps that format and it would both be cumbersome to try and get the script owner to modify the output to use our instead of my and this could anyways possibly effect currently existing downstream flows that depend on this specific format. As for why we didn’t use a yml in the first place, no idea lol

For reference, I need to take a list of keys from within the hash and iterate over each element

submitted by /u/Its-goodtobetheking
[link] [comments]