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.

(cherry picked from commit 8af56b9)
  • Loading branch information
Father Chrysostomos authored and steve-m-hay committed Jan 13, 2015
1 parent 914a149 commit daabf9f
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 @@ -970,6 +970,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 @@ -4152,12 +4159,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 @@ -483,7 +483,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 daabf9f

Please sign in to comment.