This code was recently moved from lib/locale.t to a new file essentially
unchanged, so that it could be common code. It deletes several
environment variables, such as PATH, to avoid interference with going
out and looking at the locales. In lib/locale.t, those environment
variables are not needed again, but that isn't true of all the callers.
The solution is simply to localize the removal.
This should fix [perl #121106], but there remain test failures there.
# program without the taint mode getting grumpy.
# $ENV{PATH} is special in VMS.
- delete $ENV{PATH} if $^O ne 'VMS' or $Config{d_setenv};
+ delete local $ENV{PATH} if $^O ne 'VMS' or $Config{d_setenv};
# Other subversive stuff.
- delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
+ delete local @ENV{qw(IFS CDPATH ENV BASH_ENV)};
if (-x "/usr/bin/locale"
&& open(LOCALES, "/usr/bin/locale -a 2>/dev/null|"))