Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Issue with env variables set through dos batch

by akrrs7 (Acolyte)
on Oct 13, 2011 at 17:25 UTC ( #931334=note: print w/ replies, xml ) Need Help??


in reply to Re: Issue with env variables set through dos batch
in thread Issue with env variables set through dos batch

Hello Ikegami... Yes..I cannot modify the batch file. It is as it is and I was thinking of doing one of 2 things: 1. Small batch/shell script that first calls the env var batch/shell script and then my perl script - this would ensure that the env variables are set before my perl script is executed. 2. Use the File Open in Perl to read the batch/shell script and execute each line like a perl command....not sure if do-able ?


Comment on Re^2: Issue with env variables set through dos batch
Re^3: Issue with env variables set through dos batch
by ikegami (Pope) on Oct 13, 2011 at 17:46 UTC

    You forgot 3. Use the solution I provided.

    (1) is the simplest.

      Hello Ikegami... Yes...thanks. That should be the easiest. I will try it out. Thanks...
Re^3: Issue with env variables set through dos batch
by dasgar (Deacon) on Oct 13, 2011 at 17:57 UTC

    What you described in #1 should work. This is very similar to what happens with the portable version of Strawberry Perl.

    In the case of portable Strawberry Perl, there's batch script that you run first and it does two things: opens a command prompt window and sets the environment variables for just that command prompt window. From there, you can run your scripts and Windows will know where to find all of the Perl files (perl.exe, "installed" modules, etc.) for the portable Strawberry Perl.

    Also, I haven't tested it, but ikegami's suggestion looks like it should work too.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://931334]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2014-12-19 23:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (94 votes), past polls