README
1NAME
2 Shell::Source - run programs and inherit environment changes
3
4DESCRIPTION
5 The Shell::Source allows arbitrary shell scripts, or other programs for
6 that matter, to be run and their environment to be inherited into a Perl
7 program.
8
9 Begin by creating a Shell::Source object, and specifying the shell it
10 will use.
11
12 If the shell is unknown to the module, you will also need to specify how
13 to run the shell in such a way that the output is a series of lines of
14 the form NAME=value. For example, to run a csh script:
15
16 my $csh = Shell::Source->new(shell => "csh",
17 file => "stuff.csh",
18 run => "csh -f -c 'source [[file]]; env' |");
19
20 However, for known shells this is not required. Note that [[file]] will
21 be replaced with the filename of the program you want to run.
22
23 Output from running the program is returned from $csh->output.
24
25 Changes made to the environment by running the program may be inherited
26 by calling $csh->inherit.
27
28 The environment changes are available as a hash from $csh->env, or in
29 Bourne shell syntax from $csh->shell.
30
31