[Israel.pm] setenv in perl

Jason Elbaum Jason.Elbaum at freescale.com
Thu Sep 2 06:23:51 PDT 2004


You can access environment variables *within* a perl script by using the 
%ENV hash, which contains all the system environment variables. However, 
changes you make there will not affect the parent process.

The only way to affect the environment of the parent process is by 
writing the setenv commands to a file and source'ing it from the parent 
script.


Jason Elbaum
Freescale Semiconductor Israel


Shlomi Bakish wrote:
> 
> I'm working on unix platform.
> I have a device that uses a proriety programing language (very limited). 
> I can run a perl script from within the code,
> but the only 2 ways to get back a result, is by reading a file, or 
> reading environment variables.
> I don't want to use files for transfering a single result.
> how can I use perl to do setenv ? 'system' seems to use sh, no setenv 
> there.
> Even if I could do setenv, will it still be defined in the parent process ?
> 
> 
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
> 


-- 
[X] Freescale General Business Information
[ ] Freescale Internal Use Only
[ ] Freescale Confidential Proprietary



More information about the Perl mailing list