if ((o->op_flags & OPf_KIDS) && ckWARN(WARN_DEPRECATED)) {
switch (cUNOPo->op_first->op_type) {
case OP_RV2AV:
+ break; /* Globals via GV can be undef */
case OP_PADAV:
case OP_AASSIGN: /* Is this a good idea? */
Perl_warner(aTHX_ WARN_DEPRECATED,
"(Maybe you should just omit the defined()?)\n");
break;
case OP_RV2HV:
+ break; /* Globals via GV can be undef */
case OP_PADHV:
Perl_warner(aTHX_ WARN_DEPRECATED,
"defined(%hash) is deprecated");
defined(@array) is deprecated
(Maybe you should just omit the defined()?)
- defined @a ;
my @a ; defined @a ;
defined (@a = (1,2,3)) ;
defined(%hash) is deprecated
(Maybe you should just omit the defined()?)
- defined %h ;
my %h ; defined %h ;
Mandatory Warnings
########
# op.c
use warning 'deprecated' ;
-defined(@a);
-EXPECT
-defined(@array) is deprecated at - line 3.
-(Maybe you should just omit the defined()?)
-########
-# op.c
-use warning 'deprecated' ;
my @a; defined(@a);
EXPECT
defined(@array) is deprecated at - line 3.
########
# op.c
use warning 'deprecated' ;
-defined(%h);
-EXPECT
-defined(%hash) is deprecated at - line 3.
-(Maybe you should just omit the defined()?)
-########
-# op.c
-use warning 'deprecated' ;
my %h; defined(%h);
EXPECT
defined(%hash) is deprecated at - line 3.