in reply to Getting the ENV from the .bat file

Each process has its own environment it inherits from its parent when its created. You can't change another process's environment.

The usual trick is to have the batch file display its environment and have the caller parse that.

Replies are listed 'Best First'.
Re^2: Getting the ENV from the .bat file
by u671296 (Sexton) on Feb 18, 2009 at 15:03 UTC
    Agreed. You're doing things back to front. The batch file sets up the environment then runs the Perl script, not the other way round.

    If you want to do it the other way round the batch file is actually a configuration file, so just read in values e.g.
    host:myhost.somewhere.com
    port:389
    basedn:dc=myldap