summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-12-04 09:53:55 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-12-04 10:51:22 -0800
commit90b58ec9e4b2574a8f7f11a0215f42453cfbc0a1 (patch)
tree060d70e0675340b11c84a2743634ec97e14bfa6b /op.c
parent668a86254af1576eb43991facafcf3693c919b3f (diff)
downloadperl-90b58ec9e4b2574a8f7f11a0215f42453cfbc0a1.tar.gz
Deprecate lexical $_
See tickets #114020 and #75598 for why. The changes to tests in cpan/Text-Tabs have been submitted upstream at rt.cpan.org #81698.
Diffstat (limited to 'op.c')
-rw-r--r--op.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/op.c b/op.c
index 18afb4b424..b0a30731fb 100644
--- a/op.c
+++ b/op.c
@@ -578,6 +578,13 @@ Perl_allocmy(pTHX_ const char *const name, const STRLEN len, const U32 flags)
PL_parser->in_my == KEY_state ? "state" : "my"), flags & SVf_UTF8);
}
}
+ else if (len == 2 && name[1] == '_' && !is_our)
+ /* diag_listed_as: Use of my $_ is deprecated */
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
+ "Use of %s $_ is deprecated",
+ PL_parser->in_my == KEY_state
+ ? "state"
+ : "my");
/* allocate a spare slot and store the name in that slot */