From 4052d21cf21adbbdc9b825b0bd88d7c5804670eb Mon Sep 17 00:00:00 2001 From: Vincent Pit Date: Thu, 20 Mar 2008 13:06:47 +0100 Subject: [PATCH] Double warning with perl -we '\&$x' From: "Vincent Pit" Message-ID: <38561.147.210.17.175.1206011207.squirrel@147.210.17.175> p4raw-id: //depot/perl@33544 --- sv.c | 2 +- t/lib/warnings/9uninit | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sv.c b/sv.c index 4d7f32d..603cb3b 100644 --- a/sv.c +++ b/sv.c @@ -7910,7 +7910,7 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **const st, GV **const gvp, const I32 lref) LEAVE; if (!GvCVu(gv)) Perl_croak(aTHX_ "Unable to create sub named \"%"SVf"\"", - SVfARG(sv)); + SVfARG(SvOK(sv) ? sv : &PL_sv_no)); } return GvCVu(gv); } diff --git a/t/lib/warnings/9uninit b/t/lib/warnings/9uninit index bbaba19..9316dc8 100644 --- a/t/lib/warnings/9uninit +++ b/t/lib/warnings/9uninit @@ -1070,8 +1070,6 @@ reset $m1; reset $g1; EXPECT Use of uninitialized value $m1 in subroutine dereference at - line 5. -Use of uninitialized value $m1 in subroutine dereference at - line 5. -Use of uninitialized value $g1 in subroutine dereference at - line 6. Use of uninitialized value $g1 in subroutine dereference at - line 6. Use of uninitialized value $m1 in splice at - line 9. Use of uninitialized value $g1 in splice at - line 9. -- 2.7.4