473,587 Members | 2,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

appending to PATH

2 New Member
So many web sites state that $ENV{‘PATH’} = “/newpath:$ENV{‘ PATH’}”; should append to path.

When I include that in perl code, and echo $PATH afterwards, or just type env, there is no change in $path. ???

Any ideas? Thanks.
M.
Sep 23 '08 #1
1 2803
numberwhun
3,509 Recognized Expert Moderator Specialist
In a Perl script, the %ENV variable is actually a hash. Each variable in the hash is a key which has a value. One of those keys is "PATH", which contains the system path contents. The %ENV hash contains the CGI Envornment variables.

To print it out, use this:

Expand|Select|Wrap|Line Numbers
  1. print "Content-type: text/html\n\n";
  2. print "<tt>\n";
  3. foreach $key (sort keys(%ENV)) {
  4.       print "$key = $ENV{$key}<p>";
  5. }
  6.  
To modify the hash, I would look up a tutorial on hashes if you don't already know how.

Regards,

Jeff
Sep 23 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2262
by: ketulp_baroda | last post by:
Hi I am having a problem in appending to sys.path I am doing it this way: >>> sys.path >>> sys.path.append(r'D:\Python23\Lib\site-packages\code') >>> sys.path But when I close the shell and now again open it & do sys.path , it
0
1536
by: Greg McIntyre | last post by:
Out of interest, are there any standard Python modules that do this: def appendRelativeIncludePath(*relpath): dir = os.path.abspath(os.path.join(os.path.dirname(__file__), *relpath)) if not dir in sys.path: sys.path.append(dir) I ask because I often find myself doing this: ----
1
2447
by: Jonathan Taylor | last post by:
I have a large XML file, that is too large to read in to XmlDocument. I need to append data to this XML file without creating a new file, since I don't want to have two copies of the large file on the server. I've not seen any example that works so far, even with google. Can anyone help ?
16
12597
by: Michael | last post by:
I have a data application in a2k that I need to create two fixed width text files and then combine them to a single file The first file is header information and the second is transaction data. I have tried and tried but just cant seem to get this right, I am using Queries to created my export files with specifications which works fine, I...
9
12325
by: Pete | last post by:
Does anyone have a simple html vbscript or other type of snippet they can share that appends a record to a access database via ADO or DAO? I would like to allow users that don't have Microsoft Access a way of adding records to a access database from a simple web page. I don't want to have to setup ODBC or anything like that I just want to put...
3
1909
by: MLH | last post by:
I have a query, qryAppend30DayOld260ies that attempts to append records to tblCorrespondence. When run, it can result in any of the following: appending no records, appending 1 record or appending many records. Two of the target fields in tblCorrespondence receiving values in the append operation are and . For any given VehicleJobID value, I...
4
1660
by: John A Grandy | last post by:
could someone explain the following to me : Appending the literal type character I to a literal forces it to the Integer data type. Appending the identifier type character % to any identifier forces it to Integer.
4
3809
by: Gordon | last post by:
Is it possible in, say, a .htaccess file, to append additional paths to the php include_path without knowing what the value of include_path is beforehand? I want to add an absolute path to a directory and it's subdirectories from a .htaccess file, but I don't want to have to encode the entire current value of it and append my own path as that...
4
1486
by: John [H2O] | last post by:
I have a glob.glob search: searchstring = os.path.join('path'+'EN*') files = glob.glob(searchstring) for f in files: print f ___ This returns some files:
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.