in reply to Set shell environment variables using perl
See Changing parent process environment variable for Windows and Set shell environment variables from within a perl script for unixish systems.