Skip to content

Commit daabf9f

Browse files
Father Chrysostomossteve-m-hay
authored andcommitted
perldiag: Reunite ‘perhaps you forgot to load’
to the other part of the message. diagnostics.pm won’t find it otherwise: $ perl -Mdiagnostics -we '"foo"->bar' Can't locate object method "bar" via package "foo" (perhaps you forgot to load "foo"?) at -e line 1 (#1) Uncaught exception from user code: Can't locate object method "bar" via package "foo" (perhaps you forgot to load "foo"?) at -e line 1. Now we have this: Can't locate object method "bar" via package "foo" (perhaps you forgot to load "foo"?) at -e line 1 (#1) (F) You called a method on a class that did not exist, and the method could not be found in UNIVERSAL. This often means that a method requires a package that has not been loaded. Uncaught exception from user code: Can't locate object method "bar" via package "foo" (perhaps you forgot to load "foo"?) at -e line 1. (cherry picked from commit 8af56b9)
1 parent 914a149 commit daabf9f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pod/perldiag.pod

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,13 @@ unable to locate this library. See L<DynaLoader>.
970970
functioning as a class, but that package doesn't define that particular
971971
method, nor does any of its base classes. See L<perlobj>.
972972

973+
=item Can't locate object method "%s" via package "%s" (perhaps you forgot
974+
to load "%s"?)
975+
976+
(F) You called a method on a class that did not exist, and the method
977+
could not be found in UNIVERSAL. This often means that a method
978+
requires a package that has not been loaded.
979+
973980
=item Can't locate package %s for @%s::ISA
974981

975982
(W syntax) The @ISA array contained the name of another package that
@@ -4152,12 +4159,6 @@ the nesting limit is exceeded.
41524159
command-line switch. (This output goes to STDOUT unless you've
41534160
redirected it with select().)
41544161

4155-
=item (perhaps you forgot to load "%s"?)
4156-
4157-
(F) This is an educated guess made in conjunction with the message
4158-
"Can't locate object method \"%s\" via package \"%s\"". It often means
4159-
that a method requires a package that has not been loaded.
4160-
41614162
=item Perl folding rules are not up-to-date for 0x%X; please use the perlbug
41624163
utility to report; in regex; marked by S<<-- HERE> in m/%s/
41634164

t/porting/diag.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ Can't fix broken locale name "%s"
483483
Can't get short module name from a handle
484484
Can't load DLL `%s', possible problematic module `%s'
485485
Can't locate %s: %s
486-
Can't locate object method "%s" via package "%s" (perhaps you forgot to load "%s"?)
487486
Can't pipe "%s": %s
488487
Can't set type on DOS
489488
Can't spawn: %s

0 commit comments

Comments
 (0)