Environment vars

Discussion in 'Perl' started by SG, Aug 14, 2004.

  1. SG

    SG Guest

    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 -----
     
    SG, Aug 14, 2004
    #1
    1. Advertising

  2. 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 -----
     
    Darin McBride, Aug 14, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon

    app vars and cache vars

    Jon, Dec 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    426
  2. The Jetman
    Replies:
    0
    Views:
    286
    The Jetman
    Jan 15, 2004
  3. Replies:
    5
    Views:
    699
  4. Linuxguy123
    Replies:
    7
    Views:
    732
    Paddy O'Loughlin
    Feb 20, 2009
  5. caccolangrifata
    Replies:
    18
    Views:
    428
    Chris Torek
    Jul 22, 2011
Loading...

Share This Page