Reidy, Ron wrote:
Oscar,
Short answer - you cannot (sort of). This is because your shell script
will execute in a sub shell of your perl program.
However, you can do something like this:
# untested
system("export VAR=val; /path/to/your/shell/script.sh");
The shell also takes a series of zero or more key-value pairs at the start of
any command:
system("VAR=val VAR2=anotherval /path/to/any/program");
This has the same effect as exporting when you're doing it with Perl's system call, but it's good to
keep in mind when you don't want to keep the variable setting or override in your general shell
session. i.e.
LD_PRELOAD=/usr/lib/special_old_library.so /usr/bin/oldprogram
Scott Smith
Genome Sequencing Center