diff options
author | Father Chrysostomos <sprout@cpan.org> | 2016-08-04 23:23:09 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2016-08-04 23:23:09 -0700 |
commit | 458470f62360040dcd4b5a55c8ba07503e1af5fc (patch) | |
tree | 7f1783ae726e313bdd4b98a36462695df792023e /dist | |
parent | 360cebfddd02d757c50e0679b64d657a2af7b212 (diff) | |
download | perl-458470f62360040dcd4b5a55c8ba07503e1af5fc.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.
Diffstat (limited to 'dist')
-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 c7f99639be..38c91c731c 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'; |