From daabf9ffb7578e4b888dfec9013c4642e70cbf32 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Tue, 13 Jan 2015 13:29:31 +0000 Subject: [PATCH] =?UTF-8?q?perldiag:=20Reunite=20=C3=A2=E2=82=AC=CB=9Cperh?= =?UTF-8?q?aps=20you=20forgot=20to=20load=C3=A2=E2=82=AC=E2=84=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 8af56b9d4cb926792c8f72b634303126a5b1d860) --- pod/perldiag.pod | 13 +++++++------ t/porting/diag.t | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pod/perldiag.pod b/pod/perldiag.pod index bae6e4eb8aa8..3c17a14bf74a 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -970,6 +970,13 @@ unable to locate this library. See L. functioning as a class, but that package doesn't define that particular method, nor does any of its base classes. See L. +=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 @@ -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/ diff --git a/t/porting/diag.t b/t/porting/diag.t index d3e0021b7a7b..e7df6ec67a1e 100644 --- a/t/porting/diag.t +++ b/t/porting/diag.t @@ -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