proper error on "grep $x (1,2,3)". Solves [perl #37314]
[p5sagit/p5-mst-13.2.git] / t / op / grep.t
index d7fe515..456b6c5 100644 (file)
@@ -10,7 +10,7 @@ BEGIN {
 }
 
 require "test.pl";
-plan( tests => 60 );
+plan( tests => 61 );
 
 {
     my @lol = ([qw(a b c)], [], [qw(1 2 3)]);
@@ -207,3 +207,10 @@ plan( tests => 60 );
     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]");
+}