On Wed, Sep 30, 2009 at 04:48:41PM +0200, Alexander Indenbaum wrote:
> Hello,
> 
> I have bash script which alters environment, kind of configuration,
> let's say config.env.
> 
> I'd like to import this environment in context of perl script.  How do
> I do equivalent to 'source config.env' from perl code? I mean I could
> just run bash in subprocess, but it would not alter perl process
> environment.

Here's something written by another member of this list after a certain
shell script has been converted to perl but was still required to use
the original configuration:

http://svn.asterisk.org/svn/zaptel/tags/1.4.12.1/kernel/xpp/utils/zconf/Zaptel/Config/Defaults.pm

It runs a separate sh subprocess with a controlled environment which
sources the file and then prints out a pre-defined set of variables. The
script then parses out the values of those variables.

-- 
Tzafrir Cohen         | [email protected] | VIM is
http://tzafrir.org.il |                    | a Mutt's
[email protected] |                    |  best
ICQ# 16849754         |                    | friend

_______________________________________________
Linux-il mailing list
[email protected]
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to