Hi, Perl should inherit whatever the environment shell it is called in. Id be interested to know if you listed you environment variables before calling perl if they are there. I just had to write code for perl last week ( on UNIX) concerning environment variables. It was being called from a program where the needed shell environments which weren't weren't set but I needed to have them to access DB2 and only had one line so I had to first source the profile to get trhe environments in the current shell then use a semicolon to be able to run two commands on the same line ( a limitation of the app) i.e.
. ./home/db2/.profile;/usr/local/bin/script.pl Am I correct to understand that on the dos prompt if you tpe set it shows the correct environment variable. You then call a batch file that does a few commands then calls perl and perl doesn't have the environment variables? It should unless the batch file commands prior to it span a new unitialized shell for some reason. I guess you could either tell us what the batch is doing before calling perl OR pass the environment variables into perl as arguments when you call perl or by redirecting set to a file then reading in the file from perl i.e. set > set.out then in perl OPEN set.out with a filehandle and read the value you need. Is the real problem that when a new dos command shell is created by perl, THAT NEW DOS shell which is created by perl somehow doesn't have the same environment variables? On 9/9/06, john wright <[EMAIL PROTECTED]> wrote:
Hi I am calling vcvars32.bat using system call in perl program,but the variables set in the batch file are lost when the execution come out of the system call.i want preserve all variables values define in the vcvars32.bat in my perl program after executing the vcvars32.bat. Thanks John *"Jack Faley ( The Tao of Jack )" < [EMAIL PROTECTED]>* wrote: Do these variables change while perl is running? Otherwise you could set the variables in the batch file and have it call perl. On 9/8/06, john wright wrote: > > Hi All, > I want to call vcvars32.bat from perl script and effectively borrow the > variables from that batch file. If I use system call, the variables set in > the batch file are lost when the execution come out of the system call . > > Thanks > John > > > --------------------------------- > How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call > rates. > -- ------------------------------ How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call rates. <http://us.rd.yahoo.com/mail_us/taglines/postman8/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com>
-- -------------------------------------------------------- Why is this technology an anathema to me?