Solved

Setting the Environment varable

Posted on 2000-03-06
5
149 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now