Connecting Tech Pros Worldwide Help | Site Map

setting environment variables, then running perl script on Win32

Newbie
 
Join Date: Dec 2007
Posts: 5
#1: Dec 20 '07
Hi.

I have a Perl script that starts a build process (plus a lot of other things). The build process needs a few environment variables set. This is done automatically in a buildEnv.bat script supplied by the build system vendor.

My first idea was to write a .bat scrpt that first calls the buildEnv.bat script and then calls the perl script. This does not seem to work since the perl script never executes.

The .bat file looks like this:
Expand|Select|Wrap|Line Numbers
  1. C:\Tornado\host\x86-win32\bin\torVars.bat
  2.  
  3. perl run_make_and_post_processing.pl --input project_config.ini
  4.  
What are the alternatives?

OS: Windows XP SP2
Perl: Vanilla Perl
Newbie
 
Join Date: Dec 2007
Posts: 5
#2: Dec 21 '07

re: setting environment variables, then running perl script on Win32


The solution is to prefix the lines with "call". See below.

File something.bat:
Expand|Select|Wrap|Line Numbers
  1. call C:\Tornado\host\x86-win32\bin\torVars.bat
  2.  
  3. call perl run_make_and_post_processing.pl --input project_config.ini
  4.  
Reply