pod/perldelta.pod: document reversion of ENV{foo} = undef behaviour in delta
t/op/magic.t: add a test for ENV{foo} = undef
dVAR;
STRLEN len = 0, klen;
const char * const key = MgPV_const(mg,klen);
- const char *s = NULL;
+ const char *s = "";
PERL_ARGS_ASSERT_MAGIC_SETENV;
If any exist, they are bugs, and we request that you submit a
report. See L</Reporting Bugs> below.
+=head2 C<$ENV{foo} = undef> no longer deletes value from environ
+
+5.17.3 Introduced a change where assiging C<undef> to an C<%ENV> key was equivalent
+to C<delete $ENV{foo}>.
+
+This release reverts that change.
+
[ List each incompatible change as a =head2 entry ]
=head1 Deprecations
chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
- plan (tests => 178);
+ plan (tests => 179);
}
# Test that defined() returns true for magic variables created on the fly,
}
$ENV{__NoNeSuCh} = 'foo';
+ $ENV{__NoNeSuCh2} = 'foo';
$0 = 'bar';
env_is(__NoNeSuCh => 'foo', 'setting $0 does not break %ENV');
+ $ENV{__NoNeSuCh2} = undef;
+ env_is(__NoNeSuCh2 => '', 'setting a key as undef does not delete it');
+
# stringify a glob
$ENV{foo} = *TODO;
env_is(foo => '*main::TODO', 'ENV store of stringified glob');