summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-07-04 06:11:27 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-07-04 08:53:50 -0700
commita2e392149708327a5f56db7babd3692619a2f08a (patch)
tree25a6273d6aaa852544c6a16ae8b23b80463dd90c /op.c
parent8023b71189cc47b06d6a28e1d2e4c213c4d0d4d8 (diff)
downloadperl-a2e392149708327a5f56db7babd3692619a2f08a.tar.gz
Use ‘state’ in warning about sort {state $a}
Diffstat (limited to 'op.c')
-rw-r--r--op.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/op.c b/op.c
index 14cc21fc08..311f5a0ac8 100644
--- a/op.c
+++ b/op.c
@@ -9350,8 +9350,10 @@ S_simplify_sort(pTHX_ OP *o)
SV * const name = AvARRAY(PL_comppad_name)[kid->op_targ];
if (SvCUR(name) == 2 && *SvPVX(name) == '$'
&& (SvPVX(name)[1] == 'a' || SvPVX(name)[1] == 'b'))
+ /* diag_listed_as: "my %s" used in sort comparison */
Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
- "\"my %s\" used in sort comparison",
+ "\"%s %s\" used in sort comparison",
+ SvPAD_STATE(name) ? "state" : "my",
SvPVX(name));
}
} while ((kid = kid->op_sibling));