summaryrefslogtreecommitdiff
path: root/dist/Env
diff options
context:
space:
mode:
authorTom Hukins <tom@eborcom.com>2020-08-26 10:56:13 +0100
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2020-08-26 12:12:07 +0100
commitce039238c523d4cfeaba421697746329fa713515 (patch)
tree0d65d976c2527c799339fcbb8ff52dad9b7b0d5f /dist/Env
parent1bcd2b1aee74f2ba50377a754ed86fad37cc4e9b (diff)
downloadperl-ce039238c523d4cfeaba421697746329fa713515.tar.gz
Stop implying "." belongs in $ENV{PATH}
Instead, use an arbitrary path that has less chance of encouraging people to allow the current directory in their path. This was prompted by #16951 and attached as a patch to that issue which was mistakenly closed without fixing the problem.
Diffstat (limited to 'dist/Env')
-rw-r--r--dist/Env/lib/Env.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/dist/Env/lib/Env.pm b/dist/Env/lib/Env.pm
index 6e6cd8b230..eaf30f15a3 100644
--- a/dist/Env/lib/Env.pm
+++ b/dist/Env/lib/Env.pm
@@ -1,6 +1,6 @@
package Env;
-our $VERSION = '1.04';
+our $VERSION = '1.05';
=head1 NAME
@@ -35,7 +35,7 @@ You may access its value
or modify it
- $PATH .= ":.";
+ $PATH .= ":/any/path";
push @LD_LIBRARY_PATH, $dir;
however you'd like. Bear in mind, however, that each access to a tied array
@@ -44,15 +44,16 @@ variable requires splitting the environment variable's string anew.
The code:
use Env qw(@PATH);
- push @PATH, '.';
+ push @PATH, '/any/path';
-is equivalent to:
+is almost equivalent to:
use Env qw(PATH);
- $PATH .= ":.";
+ $PATH .= ":/any/path";
except that if C<$ENV{PATH}> started out empty, the second approach leaves
-it with the (odd) value "C<:.>", but the first approach leaves it with "C<.>".
+it with the (odd) value "C<:/any/path>", but the first approach leaves it with
+"C</any/path>".
To remove a tied environment variable from
the environment, assign it the undefined value