system runs a subprocess, and because a subprocess gets its own copy of the environment, you cannot set/modify an environment variable from within a subprocess such that it will be available to the parent process (your Perl script here). In other words, the new subprocess' environment is gone as soon as the process has ended, i.e. when system returns. Exporting won't help.
But you could print the variable's value to stdout in the shell script, and capture it in the Perl script (e.g. via backticks).
In reply to Re: Call shell script variables in perl
by Eliya
in thread Call shell script variables in perl
by k_manimuthu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |