You can also use:
$ENV{$var} = $value;
to set the environment variables. This will only last for the scope of your script. E.g. once you exit your script and go back to your cmd.exe shell, $var will be what it was before you ran your script.
--
.dave.