diff options
author | Mark-Jason Dominus <mjd@plover.com> | 1999-05-27 12:05:44 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-05-28 16:53:04 +0000 |
commit | 697943021785eb8447e25eb51a6f27fd78921863 (patch) | |
tree | ff410b34951b3231735fd69c7969267fe684fde3 /op.c | |
parent | d6a255e6be67358d1e8a71b939edbfc895ee4fa6 (diff) | |
download | perl-697943021785eb8447e25eb51a6f27fd78921863.tar.gz |
PATCH (5.005_57): defined(@a) now deprecated
To: perl5-porters@perl.com
Message-ID: <19990527200544.13330.qmail@plover.com>
p4raw-id: //depot/cfgperl@3498
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -5009,6 +5009,30 @@ ck_lfun(OP *o) } OP * +ck_defined(OP *o) /* 19990527 MJD */ +{ + if (ckWARN(WARN_DEPRECATED)) { + switch (cUNOPo->op_first->op_type) { + case OP_RV2AV: + case OP_PADAV: + case OP_AASSIGN: /* Is this a good idea? */ + warner(WARN_DEPRECATED, "defined(@array) is deprecated (and not really meaningful)"); + warner(WARN_DEPRECATED, "(Maybe you should just omit the defined()?)\n"); + break; + case OP_RV2HV: + case OP_PADHV: + warner(WARN_DEPRECATED, "defined(%hash) is deprecated (and not really meaningful)"); + warner(WARN_DEPRECATED, "(Maybe you should just omit the defined()?)\n"); + break; + default: + /* no warning */ + break; + } + } + return ck_rfun(o); +} + +OP * ck_rfun(OP *o) { OPCODE type = o->op_type; |