in reply to Environment Variables in YAML

Change single quotes to Double in this line, and it works:
my ($hashref) = Load(<<"...");
From "<<EOF" (here-doc) in perlop:

Double quotes indicate that the text will be interpolated using exactly the same rules as normal double quoted strings.

        “The sources of quotes found on the internet are not always reliable.” — Abraham Lincoln.3; cf.

Replies are listed 'Best First'.
Re^2: Environment Variables in YAML
by MidLifeXis (Monsignor) on Nov 17, 2015 at 14:05 UTC

    ...which works in the case of the sample provided in the original post; in the case of "YAML files" (emphasis added), as was also stated in the original post, it will not. The OP was providing a self contained example (kudos to the OP).

    --MidLifeXis

      Ah - I missed that subtle reference to YAML "Files". Thanks for pointing that out.

      But if you are creating a YAML file, why would you embed environment variables like that ? Sounds like a case for using a template style tool.

      I'm leaving it to the OP to post a snippet closer to his actual circumstances.

              “The sources of quotes found on the internet are not always reliable.” — Abraham Lincoln.3; cf.

        Thanks for your reply. Just curious as to what is this template style tool you mentioned. Can you provide some pointers regarding this