diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 47c23eb60fdc..0adabf516929 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -6658,16 +6658,6 @@ one. This doesn't make sense. Perl will continue, assuming a Unicode happens to be ISO-8859-1 (Latin1) where this message is spurious and can be ignored. -=item Use of chdir('') or chdir(undef) as chdir() deprecated - -(D deprecated) chdir() with no arguments is documented to change to -$ENV{HOME} or $ENV{LOGDIR}. chdir(undef) and chdir('') share this -behavior, but that has been deprecated. In future versions they -will simply fail. - -Be careful to check that what you pass to chdir() is defined and not -blank, else you might find yourself in your home directory. - =item Use of /c modifier is meaningless in s/// (W regexp) You used the /c modifier in a substitution. The /c diff --git a/pp_sys.c b/pp_sys.c index beca14a879b4..1c2ef9c1f229 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -3591,8 +3591,7 @@ PP(pp_chdir) else if (!(gv = MAYBE_DEREF_GV(sv))) tmps = SvPV_nomg_const_nolen(sv); } - - if( !gv && (!tmps || !*tmps) ) { + else { HV * const table = GvHVn(PL_envgv); SV **svp; @@ -3603,8 +3602,6 @@ PP(pp_chdir) #endif ) { - if( MAXARG == 1 ) - deprecate("chdir('') or chdir(undef) as chdir()"); tmps = SvPV_nolen_const(*svp); } else { diff --git a/t/op/chdir.t b/t/op/chdir.t index 813b0edc2ef5..84159fe62a85 100644 --- a/t/op/chdir.t +++ b/t/op/chdir.t @@ -10,10 +10,11 @@ BEGIN { # possibilities into @INC. unshift @INC, qw(t . lib ../lib); require "./test.pl"; - plan(tests => 48); + plan(tests => 42); } use Config; +use Errno qw(ENOENT); my $IsVMS = $^O eq 'VMS'; @@ -150,29 +151,10 @@ sub check_env { my $warning = ''; local $SIG{__WARN__} = sub { $warning .= join '', @_ }; - - - # Check the deprecated chdir(undef) feature. -#line 64 - ok( chdir(undef), "chdir(undef) w/ only \$ENV{$key} set" ); - is( abs_path, $ENV{$key}, ' abs_path() agrees' ); - is( $warning, <