Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: config env script help building gradle from perl script (system/open tips needed)

by Corion (Pope)
on Jun 11, 2013 at 17:11 UTC ( #1038291=note: print w/replies, xml ) Need Help??


in reply to config env script help building gradle from perl script (system/open tips needed)

Why not simply write a batch file (using Perl) that invokes the environment setup, and afterwards invokes that gradle command?

call ..\\abc-env\\setenv.cmd call gradle

As an alternative, you could try a technique like Get default login environment except for Windows, and then stuff these changes into %ENV.

Replies are listed 'Best First'.
Re^2: config env script help building gradle from perl script (system/open tips needed)
by gj2666 (Beadle) on Jun 11, 2013 at 18:07 UTC
    I'm not sure I see how your suggestion is different than what I'm doing? Referencing PerlDoc I only see system(), ``, open(), and exec() as ways to execute commands in the shell. What am I missing?

      My suggestion is different because batch files executed by cmd.exe modify the environment of the cmd.exe process they are called in.

        so...
        Why not simply write a batch file (using Perl) that invokes the environment setup...
        ...you're saying create a .bat or .cmd file can be created containing perl code?

        Never occurred to me to try something like that.

        (*brain collapsing in on itself*)