Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm intending on using a Perl script to make permanant changes to an environment variable that points to a config file on Windows XP. Here's a test code to see if the procedure works:
#Environment Variable Change Script use Win32::AdminMisc; $ESYCFG="C:\\ESY\\esy.cfg"; Win32::AdminMisc::SetEnvVar("ESY_CONFIG", "$ESYCFG", ENV_USER, 10);

Should make ESY_CONFIG set to C:\ESY\esy.cfg, right? If I just put C:\\ then the variable is successfully updated to C:\, but if anything is written past the \\, the interpreter crashes! Have any ideas?

Replies are listed 'Best First'.
Re: Perl Win32::AdminMisc::SetEnvVar Problem
by ambrus (Abbot) on Mar 11, 2004 at 20:24 UTC
Re: Perl Win32::AdminMisc::SetEnvVar Problem (alternatives)
by tye (Sage) on Mar 12, 2004 at 03:11 UTC