Accessing environment variables from Perl 

Joined:
04/09/2007
Posts:
710

September 25, 2008 23:16:04    Last update: September 25, 2008 23:16:04
In Perl, you can use the global hash %ENV to get and set environment variables. For example, you may want to add your home directory to PATH in order to start an executable in the directory.

#!/usr/bin/perl
$ENV{'PATH'} = '/bin:/usr/bin:/home/drxi/bin';
print $ENV{'PATH'};
Share |
| Comment  | Tags
 
Easy email testing with http://www.ximailstop.com