New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error message for require "./base.pm" is wrong and confusing #15940
Comments
From @haargThis is a bug report for perl from haarg@haarg.org, The error message generated by a require like "require './base.pm';" is $ perl -e'require "./base.pm";' First, it points you towards the nonsensical module ".::base". This still applies to 5.25.11 and blead. Flags: Site configuration information for perl 5.24.1: Configured by gknop at Mon Apr 3 13:20:23 CEST 2017. Summary of my perl5 (revision 5 version 24 subversion 1) configuration: Locally applied patches: @INC for perl 5.24.1: Environment for perl 5.24.1: |
From @iabynOn Tue, Apr 04, 2017 at 04:42:50AM -0700, Graham Knop wrote:
So there are two issues here. Firstly between 5.6.0 and 5.8.0 with this $ perl561o -e'@INC=(); require "nosuch"' $ perl580o -e'@INC=(); require "nosuch"' Secondly, 5.18.0 added the helpful "(you may need to install the Foo::Bar The second issue would probably be fixed by virtue of fixing the first So does everyone agree that the change in 5.8.0 is a bug? -- |
The RT System itself - Status changed from 'new' to 'open' |
From @haargOn Wed, Apr 5, 2017 at 10:27 AM, Dave Mitchell <davem@iabyn.com> wrote:
There are other paths that will show this message, even if they can't
I do think addressing this is a bit higher priority than it has been |
From @xsawyerxOn 04/05/2017 10:56 AM, Graham Knop wrote:
I think it makes sense to show @INC only when @INC is being searched. I (In theory.)
The question is to which extent. Would we now bikeshed through the In any case, I think 5.26.1 might be a better place for this than |
From @iabynOn Tue, Apr 11, 2017 at 12:08:17PM +0200, Sawyer X wrote:
If we're going to change it, we either need to change it for 5.26.0, or I'm keen to work up a patch to fix this issue, which will also help me -- |
From @iabynOn Thu, Apr 13, 2017 at 11:00:40AM +0100, Dave Mitchell wrote:
I've just pushed the branch davem/require_fixups containing four commits. The first two commits just add more code comments around the require() The third fixes the 5.8.0 regression: the require error message no longer The fourth causes the "(you may need to install the Foo::Bar module)" previously: The first two commits have no functional changes so are not a risk for The fourth is the same as the third, except that it also broke cpan/parent/t/parent.t which was testing for a particular error message in eval q{use parent 'reallyReAlLyNotexists'}; Since parent.pm does require "$_.pm" Its not a bareword and the hint no longer appears. I think the first 3 commits should go into 5.26.0; I'm not so certain -- |
From zefram@fysh.orgDave Mitchell wrote:
That sounds like a bad idea. Previously a require on the .pm filename has
This is an example of how the equivalence between bareword require and I think the installation advice should appear in the message when, -zefram |
From @kentfredricOn 14 April 2017 at 00:24, Dave Mitchell <davem@iabyn.com> wrote:
As with what Zefram said, this not being seen the same as
In error handling/user space is just weird and surprising. Especially since such a transformation is *prolific* in Module loaders https://metacpan.org/source/BINGOS/Module-Load-0.32/lib/Module/Load.pm#L103 https://metacpan.org/source/BINGOS/Module-Load-0.32/lib/Module/Load.pm#L76-77 -- KENTNL - https://metacpan.org/author/KENTNL |
From @iabynOn Fri, Apr 14, 2017 at 10:41:19AM +1200, Kent Fredric wrote:
I've now pushed a revised branch: davem/require_fixups2 which has the same set of commits as before, except for the final one, commit 0c25175 emit require module name err hint only when valid Affected files ... -- |
From @xsawyerxOn 04/13/2017 12:00 PM, Dave Mitchell wrote:
D'oh! Yes, of course. This cannot be in a maint release.
I think this alone dictates we should have 5.25.12. While I have earlier expressed a recognition of the focusing value of |
From @iabynOn Sun, Apr 16, 2017 at 11:04:38AM +0100, Dave Mitchell wrote:
Now merged: 305ff1d [MERGE] fix require's croak message -- |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#131098 (status was 'resolved')
Searchable as RT131098$
The text was updated successfully, but these errors were encountered: