From: Rafael Garcia-Suarez Date: Sun, 7 Apr 2002 19:34:10 +0000 (+0000) Subject: Fully qualify in warning message the name of a subroutine redefined X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=910764e6d406039bd2d888fd1adf2a83fb52d1b5;p=p5sagit%2Fp5-mst-13.2.git Fully qualify in warning message the name of a subroutine redefined via glob assignment p4raw-id: //depot/perl@15789 --- diff --git a/sv.c b/sv.c index 80dc9ea..e3b9580 100644 --- a/sv.c +++ b/sv.c @@ -3839,8 +3839,9 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags) { Perl_warner(aTHX_ packWARN(WARN_REDEFINE), CvCONST(cv) - ? "Constant subroutine %s redefined" - : "Subroutine %s redefined", + ? "Constant subroutine %s::%s redefined" + : "Subroutine %s::%s redefined", + HvNAME(GvSTASH((GV*)dstr)), GvENAME((GV*)dstr)); } } diff --git a/t/lib/warnings/op b/t/lib/warnings/op index 7833562..9b20a8c 100644 --- a/t/lib/warnings/op +++ b/t/lib/warnings/op @@ -775,7 +775,7 @@ no warnings 'redefine' ; sub fred () { 1 } *fred = sub () { 2 }; EXPECT -Constant subroutine fred redefined at - line 4. +Constant subroutine main::fred redefined at - line 4. ######## # op.c use warnings 'redefine' ; diff --git a/t/lib/warnings/sv b/t/lib/warnings/sv index 3903df3..d9aa827 100644 --- a/t/lib/warnings/sv +++ b/t/lib/warnings/sv @@ -262,7 +262,7 @@ no warnings 'redefine' ; sub jim {} *jim = \&joe ; EXPECT -Subroutine fred redefined at - line 5. +Subroutine main::fred redefined at - line 5. ######## # sv.c use warnings 'printf' ;