Solved

Setting the Environment varable

Posted on 2000-03-06
5
153 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
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

840 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