From ce039238c523d4cfeaba421697746329fa713515 Mon Sep 17 00:00:00 2001 From: Tom Hukins Date: Wed, 26 Aug 2020 10:56:13 +0100 Subject: 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. --- dist/Env/lib/Env.pm | 13 +++++++------ t/porting/known_pod_issues.dat | 1 + 2 files changed, 8 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". To remove a tied environment variable from the environment, assign it the undefined value diff --git a/t/porting/known_pod_issues.dat b/t/porting/known_pod_issues.dat index 21b6091215..2e2121d1ed 100644 --- a/t/porting/known_pod_issues.dat +++ b/t/porting/known_pod_issues.dat @@ -371,6 +371,7 @@ dist/data-dumper/dumper.pm ? Should you be using L<...> instead of 1 dist/devel-ppport/parts/inc/ppphdoc Unknown directive: =dontwarn 1 dist/devel-ppport/parts/inc/ppphdoc Unknown directive: =implementation 1 dist/devel-ppport/parts/inc/ppphdoc Unknown directive: =provides 1 +dist/env/lib/env.pm ? Should you be using F<...> or maybe L<...> instead of 1 dist/exporter/lib/exporter.pm Verbatim line length including indents exceeds 79 by 2 dist/net-ping/lib/net/ping.pm Apparent broken link 2 ext/amiga-exec/exec.pm Verbatim line length including indents exceeds 79 by 1 -- cgit v1.2.1