By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,457 Members | 1,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,457 IT Pros & Developers. It's quick & easy.

Environment vars

P: n/a
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 -----
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
SG wrote:
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?


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 -----
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.