Skip to content

Commit

Permalink
perldiag: Reunite ‘perhaps you forgot to load’
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Father Chrysostomos committed Sep 19, 2014
1 parent 88938aa commit 8af56b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
13 changes: 7 additions & 6 deletions pod/perldiag.pod
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,13 @@ unable to locate this library. See L<DynaLoader>.
functioning as a class, but that package doesn't define that particular
method, nor does any of its base classes. See L<perlobj>.

=item Can't locate object method "%s" via package "%s" (perhaps you forgot
to load "%s"?)

(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.

=item Can't locate package %s for @%s::ISA

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

=item (perhaps you forgot to load "%s"?)

(F) This is an educated guess made in conjunction with the message
"Can't locate object method \"%s\" via package \"%s\"". It often means
that a method requires a package that has not been loaded.

=item Perl folding rules are not up-to-date for 0x%X; please use the perlbug
utility to report; in regex; marked by S<<-- HERE> in m/%s/

Expand Down
1 change: 0 additions & 1 deletion t/porting/diag.t
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ Can't fix broken locale name "%s"
Can't get short module name from a handle
Can't load DLL `%s', possible problematic module `%s'
Can't locate %s: %s
Can't locate object method "%s" via package "%s" (perhaps you forgot to load "%s"?)
Can't pipe "%s": %s
Can't set type on DOS
Can't spawn: %s
Expand Down

0 comments on commit 8af56b9

Please sign in to comment.