From: Father Chrysostomos Date: Sun, 8 Jul 2012 06:46:52 +0000 (-0700) Subject: ‘Undefined subroutine &foo called’ for lex subs X-Git-Tag: upstream/5.20.0~5420^2~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d2057d821be137073b284c6ce586dfd519fd13b;p=platform%2Fupstream%2Fperl.git ‘Undefined subroutine &foo called’ for lex subs instead of just ‘Undefined subroutine called’ without the name. --- diff --git a/pp_hot.c b/pp_hot.c index 0d70dfc..45c5eb7 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -2625,8 +2625,12 @@ PP(pp_entersub) SV* sub_name; /* anonymous or undef'd function leaves us no recourse */ - if (CvANON(cv) || !(gv = CvGV(cv))) + if (CvANON(cv) || !(gv = CvGV(cv))) { + if (CvNAMED(cv)) + DIE(aTHX_ "Undefined subroutine &%"HEKf" called", + HEKfARG(CvNAME_HEK(cv))); DIE(aTHX_ "Undefined subroutine called"); + } /* autoloaded stub? */ if (cv != GvCV(gv)) { diff --git a/t/cmd/lexsub.t b/t/cmd/lexsub.t index e0289b1..de5db96 100644 --- a/t/cmd/lexsub.t +++ b/t/cmd/lexsub.t @@ -132,9 +132,7 @@ is do foo(), 43, 'state sub falling out of scope (called via amper)'; } 44 } -::on; sb(1); -::off; sub sb2 { 43 } state sub sb2; sub sb2 {