in reply to windows environment variable regression

Does anyone know what else you have to do programmatically besides add a variable to another variable to get expansion to occur?

Environment variable expansion is a function of the shell. You are not involving the shell when you write directly to the registry, thus it does not occur.

If you want these directories in the path, add them to the path.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: windows environment variable regression

Replies are listed 'Best First'.
Re^2: windows environment variable regression
by mpersico (Monk) on Aug 12, 2013 at 21:12 UTC
    Yes, in *NIX land. However, I should be able to write to the registry and have subsequent shells pick up my changes. And it ALMOST works. If I write directly to the PATH, no issues. If I write the PERL_PATH variable and stick it into the PATH, then subsequent shells do NOT expand PERL_PATH in PATH. If, however, all I do is fire up the Environment Variable dialog, see that all my changes are there and then click OK (no editing, no updates), the NEXT command box has the expansion properly done. That leads me to believe that there's some other 'bit' that has to be flipped. I'll have to test by looking at the registry directly which I cannot do on the current box. More to follow.
      Yes, in *NIX land.

      I'll take your word for that as I know next to nothing about *nix.

      On the other hand I've used and programmed every version of NT since 3.51 except 7 and rt.

      If, however, all I do is fire up the Environment Variable dialog ...

      That dialog is a part of the windows graphical shell. The alternative shell to cmd.exe.

      After you've used that dialog and the %perl_path% has been expanded, check the path variable in the registry. It will no longer contain %perl_path%; it will have been replaced by the expansion.

      So why not just put the directories into the path variable to start with?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        Because I expect to change the Perl version on a regular basis and I don't want to have to parse PATH to do it.