To set them permanently you need to alter the registry: HKEY_CURRENT_USER\Environment. I suggest you use Win32::TieRegistry. Remember that this will only alter the environment for new processes, running processes will not be affected.
Comment on Re: newbie question about setting environment variables