summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2016-08-04 23:23:09 -0700
committerSteve Hay <steve.m.hay@googlemail.com>2016-08-10 08:31:57 +0100
commit6bcd39a65fd349de4dea14c3ff0ab91203000105 (patch)
tree01f3ec074451adcca7b895709b71b0c1578597d1
parentcdffa5b319d1b55b87e0e4a32787c1da448d68a3 (diff)
downloadperl-6bcd39a65fd349de4dea14c3ff0ab91203000105.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.pm9
-rw-r--r--dist/base/t/incdot.t2
2 files changed, 8 insertions, 3 deletions
diff --git a/dist/base/lib/base.pm b/dist/base/lib/base.pm
index 8be63f69e1..1aa814bff9 100644
--- a/dist/base/lib/base.pm
+++ b/dist/base/lib/base.pm
@@ -121,8 +121,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';