if (o->op_flags & OPf_STACKED) {
OP* k;
o = ck_sort(o);
- kid = cLISTOPo->op_first->op_sibling;
- if (!cUNOPx(kid)->op_next)
- Perl_croak(aTHX_ "panic: ck_grep");
- for (k = cUNOPx(kid)->op_first; k; k = k->op_next) {
+ kid = cUNOPx(cLISTOPo->op_first->op_sibling)->op_first;
+ if (kid->op_type != OP_SCOPE && kid->op_type != OP_LEAVE)
+ return no_fh_allowed(o);
+ for (k = kid; k; k = k->op_next) {
kid = k;
}
NewOp(1101, gwop, 1, LOGOP);
}
require "test.pl";
-plan( tests => 60 );
+plan( tests => 61 );
{
my @lol = ([qw(a b c)], [], [qw(1 2 3)]);
my @empty = map { while (1) {} } ();
cmp_ok("@empty", 'eq', '', 'staying alive');
}
+
+{
+ my $x;
+ eval 'grep $x (1,2,3);';
+ like($@, qr/Missing comma after first argument to grep function/,
+ "proper error on variable as block. [perl #37314]");
+}