Skip to content

Commit 8af56b9

Browse files
author
Father Chrysostomos
committed
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.
1 parent 88938aa commit 8af56b9

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
@@ -957,6 +957,13 @@ unable to locate this library. See L<DynaLoader>.
957957
functioning as a class, but that package doesn't define that particular
958958
method, nor does any of its base classes. See L<perlobj>.
959959

960+
=item Can't locate object method "%s" via package "%s" (perhaps you forgot
961+
to load "%s"?)
962+
963+
(F) You called a method on a class that did not exist, and the method
964+
could not be found in UNIVERSAL. This often means that a method
965+
requires a package that has not been loaded.
966+
960967
=item Can't locate package %s for @%s::ISA
961968

962969
(W syntax) The @ISA array contained the name of another package that
@@ -4221,12 +4228,6 @@ the nesting limit is exceeded.
42214228
command-line switch. (This output goes to STDOUT unless you've
42224229
redirected it with select().)
42234230

4224-
=item (perhaps you forgot to load "%s"?)
4225-
4226-
(F) This is an educated guess made in conjunction with the message
4227-
"Can't locate object method \"%s\" via package \"%s\"". It often means
4228-
that a method requires a package that has not been loaded.
4229-
42304231
=item Perl folding rules are not up-to-date for 0x%X; please use the perlbug
42314232
utility to report; in regex; marked by S<<-- HERE> in m/%s/
42324233

t/porting/diag.t

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

0 commit comments

Comments
 (0)