Solved

Setting the Environment varable

Posted on 2000-03-06
5
155 Views
Last Modified: 2013-12-25
From My CGI Program I want to set an Environment Variable named METAMAIL_TMPDIR. I have used

putenv("METAMAIL_TMPDIR=/home/tst/tmp");

it dint work.

I also used

system("export "METAMAIL_TMPDIR=/home/tst/tmp");

but this also does'nt work.


Can any body give me a solution.


Thanks in advance
0
Comment
Question by:LotsOfQuestions
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 10

Expert Comment

by:makerp
ID: 2587743
whats it written in C perl ????????????//
0
 
LVL 10

Expert Comment

by:makerp
ID: 2587749
what OS
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2588520
try this

$ENV{'METAMAIL_TMPDIR'}="/home/tst/tmp";

0
 
LVL 1

Expert Comment

by:ercis
ID: 2594347
I'm not sure that environment variable that you set from CGI, will stay after CGI quits ...
0
 

Accepted Solution

by:
wawb earned 50 total points
ID: 2602779
From the Perl FAQ:

I {changed directory, modified my environment} in a perl script. How come the change
disappeared when I exited the script? How do I get my changes to be visible?

Unix

     In the strictest sense, it can't be done -- the script executes as a different process from the shell it was started from. Changes to a process are not
     reflected in its parent, only in its own children created after the change. There is shell magic that may allow you to fake it by eval()ing the script's
     output in your shell; check out the comp.unix.questions FAQ for details.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question