diff options
author | Father Chrysostomos <sprout@cpan.org> | 2016-08-04 23:23:09 -0700 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2016-08-10 08:34:23 +0100 |
commit | af7067bc21e7265a4d0571e7336105a419dbba68 (patch) | |
tree | 14711c0bf5a9f81458344a5845e7d23e4429f082 | |
parent | 86fb43615de97f2306bc6d45c9d2f8e64a8ab889 (diff) | |
download | perl-af7067bc21e7265a4d0571e7336105a419dbba68.tar.gz |
[perl #128769] Improve base.pm @INC . message
The new version is based on one written by Chris Travers, polished
up a bit by yours truly.
(cherry picked from commit 458470f62360040dcd4b5a55c8ba07503e1af5fc)
-rw-r--r-- | dist/base/lib/base.pm | 9 | ||||
-rw-r--r-- | dist/base/t/incdot.t | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/dist/base/lib/base.pm b/dist/base/lib/base.pm index 12c8c896e4..b69f359076 100644 --- a/dist/base/lib/base.pm +++ b/dist/base/lib/base.pm @@ -122,8 +122,13 @@ Base class package "$base" is empty. ERROR if ($dotty && -e $fn) { $e .= <<ERROS; - If you mean to load $fn from the current directory, you may - want to try "use lib '.'". + The file $fn does exist in the current directory. But note + that base.pm, when loading a module, now ignores the current working + directory if it is the last entry in \@INC. If your software worked on + previous versions of Perl, the best solution is to use FindBin to + detect the path properly and to add that path to \@INC. As a last + resort, you can re-enable looking in the current working directory by + adding "use lib '.'" to your code. ERROS } $e =~ s/\n\z/)\n/; diff --git a/dist/base/t/incdot.t b/dist/base/t/incdot.t index fadebc4a45..1619492250 100644 --- a/dist/base/t/incdot.t +++ b/dist/base/t/incdot.t @@ -15,5 +15,5 @@ like $@, qr/\@INC contains: $inc\).\)/, 'Error does not list final dot in @INC (or mention use lib)'; eval { 'base'->import('t::lib::Dummy') }; like $@, qr<\@INC contains: $inc\).\n(?x: - ) If you mean to load t/lib/Dummy\.pm from the current >, + ) The file t/lib/Dummy\.pm does exist in the current direct>, 'special cur dir message for existing files in . that are ignored'; |