summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-01-04 11:36:25 +0100
committerNicholas Clark <nick@ccl4.org>2012-01-06 16:14:14 +0100
commit410c1a5e7498757c39d2940d00926fe55b54a3b6 (patch)
treec6a7e29ab15c5802ca57f025ab268531d5695aec
parent27a7e72b1a90477d91cc29749006be0d6ce6b9cb (diff)
downloadperl-smoke-me/deprecate-any-defined-array.tar.gz
defined(@array) now also warns for package variables.smoke-me/deprecate-any-defined-array
-rw-r--r--op.c5
-rw-r--r--pod/perldelta.pod5
-rw-r--r--t/lib/strict/refs2
-rw-r--r--t/lib/warnings/op1
4 files changed, 6 insertions, 7 deletions
diff --git a/op.c b/op.c
index b448defd67..d4dcf53272 100644
--- a/op.c
+++ b/op.c
@@ -8215,11 +8215,6 @@ Perl_ck_defined(pTHX_ OP *o) /* 19990527 MJD */
if ((o->op_flags & OPf_KIDS)) {
switch (cUNOPo->op_first->op_type) {
case OP_RV2AV:
- /* This is needed for
- if (defined %stash::)
- to work. Do not break Tk.
- */
- break; /* Globals via GV can be undef */
case OP_PADAV:
case OP_AASSIGN: /* Is this a good idea? */
Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index f980613675..356adf4667 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -327,7 +327,10 @@ tying a special array like C<@_>. You should never see this message.
=item *
-XXX L<message|perldiag/"message">
+L<defined(@array) is deprecated|perldiag/"defined(@array) is deprecated">
+
+The long-deprecated C<defined(@array)> now also warns for package variables.
+Previously it only issued a warning for lexical variables.
=back
diff --git a/t/lib/strict/refs b/t/lib/strict/refs
index 09b962f71b..d9bff7cd84 100644
--- a/t/lib/strict/refs
+++ b/t/lib/strict/refs
@@ -322,6 +322,8 @@ use strict 'refs';
my $x = "foo";
defined @$x;
EXPECT
+defined(@array) is deprecated at - line 4.
+ (Maybe you should just omit the defined()?)
Can't use string ("foo") as an ARRAY ref while "strict refs" in use at - line 4.
########
# [perl #37886] strict 'refs' doesn't apply inside defined
diff --git a/t/lib/warnings/op b/t/lib/warnings/op
index b44910316f..344cf121d7 100644
--- a/t/lib/warnings/op
+++ b/t/lib/warnings/op
@@ -799,7 +799,6 @@ my $a
EXPECT
########
# op.c
-# TODO - defined @::array doesn't warn yet.
defined(@a);
EXPECT
defined(@array) is deprecated at - line 2.