Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Environment Variable Setting

by chrestomanci (Priest)
on Apr 23, 2012 at 16:33 UTC ( #966639=note: print w/replies, xml ) Need Help??


in reply to Environment Variable Setting

On unix, child processes inherit the environment from their parent, but any changes they make are not propagated back to the parent when the child quits.

Your csh script works because it runs in the same process as your shell, so changes made in it remain after the script exits.

The usual way to create a perl script that modifies the environment is to have it emit a shell script on stdout, and then eval the script's output. eg:

eval `perl set_my_env.pl`

The perl script just prints a series of setenv NAME value lines.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://966639]
help
Chatterbox?
[Lady_Aleena]: atcroft, the whole link thing might be a question for either or both the CPAN sites. search.cpan is cpansearch@perl. org, and metacpan doesn't have an email addy for the website itself.
Lady_Aleena just followed @metacpan on Twitter.
[atcroft]: I may just post a question about it later. *shrug*
[Lady_Aleena]: I wish I could have helped you further but I've never uploaded to cpan or metacpan so I don't know much.

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2017-05-27 04:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?