diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-07-04 16:28:40 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-07-04 16:28:40 +0000 |
commit | c1899e02bd58ea340a8d89dc821ccba4502a63a7 (patch) | |
tree | e03a13cc8205f85fe3572f3ca8efb8b35b017c7d /pp_hot.c | |
parent | f199104684ce3695f33e22530039c0b087f1a163 (diff) | |
download | perl-c1899e02bd58ea340a8d89dc821ccba4502a63a7.tar.gz |
better diagnostic on Frob->stuff() when Frob:: doesn't exist
(from Richard Soderberg <rs@oregonnet.com>)
p4raw-id: //depot/perl@6306
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -2884,6 +2884,7 @@ S_method_common(pTHX_ SV* meth, U32* hashp) char* leaf = name; char* sep = Nullch; char* p; + GV* gv; for (p = name; *p; p++) { if (*p == '\'') @@ -2899,9 +2900,18 @@ S_method_common(pTHX_ SV* meth, U32* hashp) packname = name; packlen = sep - name; } - Perl_croak(aTHX_ - "Can't locate object method \"%s\" via package \"%s\"", - leaf, packname); + gv = gv_fetchpv(packname, 0, SVt_PVHV); + if (gv && isGV(gv)) { + Perl_croak(aTHX_ + "Can't locate object method \"%s\" via package \"%s\"", + leaf, packname); + } + else { + Perl_croak(aTHX_ + "Can't locate object method \"%s\" via package \"%s\" + " (perhaps you forgot to load \"%s\"?)", + leaf, packname, packname); + } } return isGV(gv) ? (SV*)GvCV(gv) : (SV*)gv; } |