in reply to setting environment-variables

In DOS/Windows, there is only one set of environment variables, not a separate environment for every process. That means that you can add the line
$ENV{x} = $result;
right at the end of your script and it will apply everywhere.

If you have a Windows NT/2000/XP system, environment vars are semi-separated -- you can edit the registry to cause a global change, or you can use the line above to control the current DOS box.

Also, foobar is a play on FUBAR, which the characters on Private Ryan used to say F00ked Up Beyond All Recognition. ;) We use it now as a nonsense word, kind of a placeholder. Do check that Jargon File reference, though, there's some interesting stuff in there!

mhoward - at - hattmoward.org