in reply to Re^2: Windows environment variable not set if calling from a perl program (goto :end)
in thread Windows environment variable not set if calling from a perl program

I did not say it solved your problem; I said that it shows how you can accomplish this.

It sounds like the easiest solution (given that you are so reluctant to admit that you can read the contents of your setEnv.bat) would be to add "call setEnv.bat" to the preamble that pl2bat would add to your Perl script.

- tye        

  • Comment on Re^3: Windows environment variable not set if calling from a perl program (call)

Replies are listed 'Best First'.
Re^4: Windows environment variable not set if calling from a perl program (call)
by svasa (Initiate) on Dec 08, 2015 at 16:31 UTC
    Thanks for the reply. How can I include "call setEnv.bat" inside a subroutine of perl - the pl2bat sure generated a .bat file, but the subroutines are still subroutines right? Can I just stick in a statement "call setEnv.bat" inside a subroutine in the generated bat file?
      How can I include "call setEnv.bat" inside a subroutine of perl

      Read more carefully? 'add "call setEnv.bat" to the preamble'

      If having the environment variables always set is a problem, then "you can't get there from here".

      - tye