Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

phpmyadmin fehler rechte unerlaubte mischung, WWWXXXApc, lilo trying to map files from unnamed device 0x0000", Wwwxxxapc, CAM::PDF::Renderer::TextF Fragen, adodb.recordset error '800a0cc1', php save mails as eml, WWWXXXAPC, sqlexpress database file auto-creation error, sqlexpress database file auto-creation error

Links

XODOX
Impressum
Datenschutz

#1: system command question

Posted on 2011-09-27 22:43:50 by Amish Rughoonundon

Hi,
I am trying to run a make file from perl. For the make file to run,
some environment variables need to be set. Usually I would use a batch
file with the following setting
SET A_DIR=C:\TOOLS\TMS320
SET C_DIR=C:\TOOLS\TMS320
PATH=%PATH%;C:\TOOLS;C:\TOOLS\TMS320
make

and it works.

I tried to do this in perl using a system call but it failed
system("SET A_DIR=C:\\TOOLS\\TMS320 & SET C_DIR=C:\\TOOLS\\TMS320 &
PATH=\%PATH\%;C:\\TOOLS;C:\\TOOLS\\TMS320 & make >
compilation_output.txt");

Any idea why the system command is not setting the path and A_DIR and
C_DIR correctly.

Thanks,
Amish


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Report this message

#2: RE: system command question

Posted on 2011-09-28 13:02:44 by Ken Slater

> -----Original Message-----
> From: Amish Rughoonundon [mailto:amishrughoonundon@gmail.com]
> Sent: Tuesday, September 27, 2011 4:44 PM
> To: beginners@perl.org
> Subject: system command question
>
> Hi,
> I am trying to run a make file from perl. For the make file to run,
> some environment variables need to be set. Usually I would use a batch
> file with the following setting
> SET A_DIR=C:\TOOLS\TMS320
> SET C_DIR=C:\TOOLS\TMS320
> PATH=%PATH%;C:\TOOLS;C:\TOOLS\TMS320
> make
>
> and it works.
>
> I tried to do this in perl using a system call but it failed
> system("SET A_DIR=C:\\TOOLS\\TMS320 & SET C_DIR=C:\\TOOLS\\TMS320 &
> PATH=\%PATH\%;C:\\TOOLS;C:\\TOOLS\\TMS320 & make >
> compilation_output.txt");
>
> Any idea why the system command is not setting the path and A_DIR and
> C_DIR correctly.
>
> Thanks,
> Amish
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
The system call spawns a separate process, so the environment variables will
be set in the spawned process only.
Try setting these environment variables through the %ENV hash which contains
the current environment.
Ken



--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Report this message