Environment vars

S

SG

I use the %ENV to access the environment variables. I came across the
following problem. When I change the environment variable from command
line, i.e
let us say origianlly env var $FOO was bar1, now I do
setenv FOO bar2
so $FOO is now bar2
it is not reflected when I access it from perl (which still says that
$ENV{FOO} is bar1). Sometimes it takes a re-login to solve this
problem. Is there an elegant way to solve this?
SG

----- End forwarded message -----
 
D

Darin McBride

SG said:
I use the %ENV to access the environment variables. I came across the
following problem. When I change the environment variable from command
line, i.e
let us say origianlly env var $FOO was bar1, now I do
so $FOO is now bar2
it is not reflected when I access it from perl (which still says that
$ENV{FOO} is bar1). Sometimes it takes a re-login to solve this
problem. Is there an elegant way to solve this?

The problem sounds more like your shell than perl.

When I want to know what my exported environment looks like, I trust
the "env" command. If your setenv FOO bar2 is working, "env | grep
FOO" should show "FOO=bar2". If it doesn't, then I would recommend
going to a newsgroup/website dedicated to your shell environment. If
env does report the changed FOO, perhaps a snippet of code that
reproduces the problem might be in order?

Sorry I can't be more help - I use bash/sh/ksh rather than csh/tcsh.

----- End forwarded message -----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top