t/op/crypt.t See if crypt works
t/op/current_sub.t __SUB__ tests
t/op/dbm.t See if dbmopen/dbmclose work
+t/op/defined.t See if defined() edge cases work
t/op/defins.t See if auto-insert of defined() works
t/op/delete.t See if delete works
t/op/die_except.t See if die/eval avoids $@ clobberage
case OP_SCALAR:
case OP_NULL:
- if (!(o->op_flags & OPf_KIDS))
+ if (!(o->op_flags & OPf_KIDS) || type == OP_DEFINED)
break;
doref(cBINOPo->op_first, type, set_op_ref);
break;
--- /dev/null
+#!perl
+BEGIN {
+ chdir 't';
+ require './test.pl';
+}
+
+plan 5;
+
+sub notdef { undef }
+
+# [perl #97466]
+# These should actually call the sub, instead of testing the sub itself
+ok !defined do { ¬def }, 'defined do { &sub }';
+ok !defined(scalar(42,¬def)), 'defined(scalar(42,&sub))';
+ok !defined do{();¬def}, '!defined do{();&sub}';
+
+# Likewise, these should evaluate @array in scalar context
+no warnings "deprecated";
+ok defined($false ? $scalar : @array), 'defined( ... ? ... : @array)';
+ok defined(scalar @array), 'defined(scalar @array)';