Re: %ENV not set by subprocesses.
Why don't you just parse the other script and look for the set statements (setenv, export, whatever)? Dunno perl, but in rexx, you could do something like this:
envsource = .stream~new(somescript.cmd)\nlines = envsource~makearray\ndo i = 1 to lines~lines\n if lines[i]~word(1) = "set"\n then do\n parse var lines[i] . envvar '=' newval\n value('OS2ENVIRONMENT', envvar, newval)\n end /* End if */\n else iterate\nend /* End do loop */\ndrop lines\nenvsource~close
Note that I haven't actually tested this, but should give you the general idea. It assumes you can read the file, of course, but if you can execute it I'm sure you can read it. Sure, it's an ugly hack, but it would work, and would permit you to let someone change the file without worrying about it breaking your program.
--\n-------------------------------------------------------------------\n* Jack Troughton jake at consultron.ca *\n* [link|http://consultron.ca|http://consultron.ca] [link|irc://irc.ecomstation.ca|irc://irc.ecomstation.ca] *\n* Kingston Ontario Canada [link|news://news.consultron.ca|news://news.consultron.ca] *\n-------------------------------------------------------------------