In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/4fa401475a3570299093ed476f400774dcfc1236?hp=2e3b2a1fba7611d1cd6060a5f07f6a0f91a06b3a>
- Log ----------------------------------------------------------------- commit 4fa401475a3570299093ed476f400774dcfc1236 Author: David Mitchell <[email protected]> Date: Fri Mar 31 09:18:48 2017 +0100 fix perldiag entry for CORE::dump() the bare form wasn't deprecated in 5.30 M pod/perldiag.pod commit 1c99110e81e1b5fb8dad0a368bf6aa2f3439cc22 Author: David Mitchell <[email protected]> Date: Fri Mar 31 09:13:33 2017 +0100 tweak 'do "%s" failed' message The warning do "%s" failed, '.' is no longer in @INC was added in the previous devel release; this commit enhances it to say do "%s" failed, '.' is no longer in @INC; did you mean do "./%s" and updates the relevant docs. See http://nntp.perl.org/group/perl.perl5.porters/243788. M pod/perl52511delta.pod M pod/perldiag.pod M pod/perlfunc.pod M pp_ctl.c M t/lib/warnings/pp_ctl ----------------------------------------------------------------------- Summary of changes: pod/perl52511delta.pod | 7 ++++--- pod/perldiag.pod | 12 ++++++------ pod/perlfunc.pod | 7 +++++-- pp_ctl.c | 5 ++++- t/lib/warnings/pp_ctl | 2 +- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/pod/perl52511delta.pod b/pod/perl52511delta.pod index 5deac54ff4..e758c0155c 100644 --- a/pod/perl52511delta.pod +++ b/pod/perl52511delta.pod @@ -97,10 +97,11 @@ L<VMS::Stdio> has been upgraded from version 2.42 to 2.41. =item * -Since C<.> is removed from C<@INC>, C<do> will now trigger a warning -recommending on fixing the C<do> statement. +Since C<.> is now removed from C<@INC> by default, C<do> will now trigger +a warning recommending to fix the C<do> statement: -L<do "%s" failed, '.' is no longer in @INC|perldiag/"do "%s" failed, '.' is no longer in @INC"> +L<do "%s" failed, '.' is no longer in @INC|perldiag/"do "%s" failed, '.' +is no longer in @INC; did you mean do "./%s"?> =back diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 9a4cdf6352..3d911cb950 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2061,13 +2061,13 @@ define a C<$VERSION>. (F) You cannot put a repeat count of any kind right after the '/' code. See L<perlfunc/pack>. -=item do "%s" failed, '.' is no longer in @INC +=item do "%s" failed, '.' is no longer in @INC; did you mean do "./%s"? (W deprecated) Previously C< do "somefile"; > would search the current -directory for the specified file. Since F<.> has been removed from -C<@INC> by default this is no longer true. To search the current -directory (and only the current directory) you can write C< do -"./somefile"; >. +directory for the specified file. Since perl v5.26.0, F<.> has been +removed from C<@INC> by default, so this is no longer true. To search the +current directory (and only the current directory) you can write +C< do "./somefile"; >. =item Don't know how to get file name @@ -2098,7 +2098,7 @@ subroutine or package before the current location. You can use an empty (D deprecated, misc) You used the obsolescent C<dump()> built-in function, without fully qualifying it as C<CORE::dump()>. Maybe it's a typo. -Use of a unqualified C<dump()> was deprecated in Perl 5.30, and this +Use of a unqualified C<dump()> was deprecated in Perl 5.8.0, and this will not be available in Perl 5.30. See L<perlfunc/dump>. diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index ae97bce829..357cd213c9 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -1829,8 +1829,11 @@ L<C<%INC>|perlvar/%INC> if the file is found. See L<perlvar/@INC> and L<perlvar/%INC> for these variables. In particular, note that whilst historically L<C<@INC>|perlvar/@INC> contained '.' (the current directory) making these two cases equivalent, that is no -longer necessarily the case, as there is now a compile-time option -to disable this behaviour. +longer necessarily the case, as '.' is not included in C<@INC> by default +in perl versions 5.26.0 onwards. Instead, perl will now warn: + + do "stat.pl" failed, '.' is no longer in @INC; + did you mean do "./stat.pl"? If L<C<do>|/do EXPR> can read the file but cannot compile it, it returns L<C<undef>|/undef EXPR> and sets an error message in diff --git a/pp_ctl.c b/pp_ctl.c index a1262323e5..3ad4c6568e 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -4120,7 +4120,10 @@ S_require_file(pTHX_ SV *sv) RESTORE_ERRNO; if (do_warn) { - Perl_warner(aTHX_ packWARN(WARN_DEPRECATED), "do \"%s\" failed, '.' is no longer in @INC", name); + Perl_warner(aTHX_ packWARN(WARN_DEPRECATED), + "do \"%s\" failed, '.' is no longer in @INC; " + "did you mean do \"./%s\"?", + name, name); } #endif CLEAR_ERRSV(); diff --git a/t/lib/warnings/pp_ctl b/t/lib/warnings/pp_ctl index 27efbcbda5..37dd4f1b7e 100644 --- a/t/lib/warnings/pp_ctl +++ b/t/lib/warnings/pp_ctl @@ -263,4 +263,4 @@ do "dounknown"; do "./dounknown"; unlink "dounknown"; EXPECT -do "dounknown" failed, '.' is no longer in @INC at - line 3. +do "dounknown" failed, '.' is no longer in @INC; did you mean do "./dounknown" at - line 3. -- Perl5 Master Repository
