[Ilugc] [OT] shell "export" inside perl

  • From: rsubr@xxxxxxxxxxxxxxxxxxxxxxxx (Raja Subramanian)
  • Date: Wed, 23 Oct 2002 18:16:09 +1000

Hi,

Elanchezhian Sivanandam wrote:

i did exported some values inside perl (using shell command
"export") but didn't get reflected in the shell after execution of the
script. How to do it???

It is not possible for a shell script to set environment variables in a
parent process. This is true for any process/program and not just perl
and shell.

In perl, the current environment is stored in the %ENV hash. You can
change your enviromnent by assigining keys/values to this hash.
See perlvar(1).

- Raja

Other related posts: