If you're using Unix (I think even a dos shell can do this sort of thing too), why
couldn't you just do a system call to the shell?

i.e. system(" export MY_Variable=whatever ");

I haven't tried this, but it sure seems like it would work -- provided you're
running and exiting the script as the same user. This is an interesting one; I'll be
interested to hear any and all feedback.

~Matt C.


--- Paul <[EMAIL PROTECTED]> wrote:
> 
> --- Hitesh Ray <[EMAIL PROTECTED]> wrote:
> > I am required to modify an Environment variable from one value to
> > another using perl script. I can access the env. variables in the
> perl
> > script using ENV. How can i modify so that when I exit my perl script
> > -- the env. variable has new value.
> 
> That's a tricky one.
> 
> I suppose you're in a shell that supports backticks?
> Have the script print the new, desired value to STDOUT.
> Then try something like 
>  VAR=`script.pl`
> 
> This has to be done in the environment where the variable resides.
> You can't have a process change the environment of its parent.
> 
> What's the context?
> I assume it's a command-line operation, but that the script has to
> figure out what the new value is to be. If that's not the case, what
> *are* you trying to do?
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Reply via email to