Select an installed module below |
NAMEEnv - perl module that imports environment variables as scalars or arrays
SYNOPSIS
use Env;
use Env qw(PATH HOME TERM);
use Env qw($SHELL @LD_LIBRARY_PATH);
DESCRIPTIONPerl maintains environment variables in a special hash named The After an environment variable is tied, merely use it like a normal variable. You may access its value
@path = split(/:/, $PATH);
print join("\n", @LD_LIBRARY_PATH), "\n";
or modify it
$PATH .= ":.";
push @LD_LIBRARY_PATH, $dir;
however you'd like. Bear in mind, however, that each access to a tied array variable requires splitting the environment variable's string anew. The code:
use Env qw(@PATH);
push @PATH, '.';
is equivalent to:
use Env qw(PATH);
$PATH .= ":.";
except that if To remove a tied environment variable from the environment, assign it the undefined value
undef $PATH;
undef @LD_LIBRARY_PATH;
LIMITATIONSOn VMS systems, arrays tied to environment variables are read-only. Attempting to change anything will cause a warning.
AUTHORChip Salzenberg <chip@fin.uucp> and Gregor N. Purdy <gregor@focusresearch.com>
|
|