Setting environment with a script

A

A. Farber

Hi,

I have a question not related to Perl's syntax, but to its usage.

I have a script which generates GNU Makefiles out of a bigger
number of input files. With that script I'd also like to
set environment variables for a build - so that I have one
big all-in-one script.

With Unix that's easy - I'll let the users call my script as

eval `create_makefiles.pl` in sh
and
eval `create_makefiles.pl -c` in csh

and generate export/setenv commands when called this way.

But what could I do to make it also work on Windows?
(in a DOS-window, not in Cygwin) Does anybody solve this
problem already or knows a module doing similar things?

Thanks
Alex
 
B

Brian McCauley

A. Farber said:
I have a question not related to Perl's syntax, but to its usage.

You've almost partitioned the problem but you've just stopped one step
short. You problem is about the ways processes can interact under
windows - the fact that one or more of the script is in Perl is not
relevant.
With Unix that's easy - I'll let the users call my script as

eval `create_makefiles.pl` in sh
and
eval `create_makefiles.pl -c` in csh

and generate export/setenv commands when called this way.

But what could I do to make it also work on Windows?

You can have the Perl script create a batch file the call that batch
file. There may be better ways but this is really a question about
Windows not Perl so perhaps you should ask in a Windows newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top