From: Vincent Pit Date: Mon, 4 Aug 2008 22:04:26 +0000 (+0200) Subject: eval '...' should be interpreted as returning a list X-Git-Tag: v0.02~16 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=5a4749d6f0c25cbc5b564453ac9abf338f660b82;p=perl%2Fmodules%2FSub-Nary.git eval '...' should be interpreted as returning a list --- diff --git a/lib/Sub/Nary.pm b/lib/Sub/Nary.pm index c44a10e..5ff0574 100644 --- a/lib/Sub/Nary.pm +++ b/lib/Sub/Nary.pm @@ -202,7 +202,7 @@ $ops{$_} = 0 for qw/stub nextstate/; $ops{$_} = 1 for qw/padsv/; $ops{$_} = 'list' for qw/padav/; $ops{$_} = 'list' for qw/padhv rv2hv/; -$ops{$_} = 'list' for qw/padany flip match/; +$ops{$_} = 'list' for qw/padany flip match entereval/; sub enter { my ($self, $cv) = @_; diff --git a/t/20-return.t b/t/20-return.t index a3eeed6..3d16d45 100644 --- a/t/20-return.t +++ b/t/20-return.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 47; +use Test::More tests => 48; use Sub::Nary; @@ -68,6 +68,8 @@ my @tests = ( [ sub { return 1, eval { $x, eval { $h{foo} } } }, 3 ], [ sub { return eval { return $x, eval { $y } } }, 2 ], [ sub { return eval { do { eval { @a } } } }, 'list' ], + + [ sub { eval 'return 1, 2' }, 'list' ], ); my $i = 1; diff --git a/t/21-list.t b/t/21-list.t index e5bbc40..c260cd3 100644 --- a/t/21-list.t +++ b/t/21-list.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 33; +use Test::More tests => 34; use Sub::Nary; @@ -56,6 +56,8 @@ my @tests = ( [ sub { eval { }; $x, 2 }, 2 ], [ sub { 1, eval { $x, eval { $h{foo} } } }, 3 ], [ sub { eval { 1, do { eval { @a }, 2 } } }, 'list' ], + + [ sub { eval '1, 2' }, 'list' ], ); my $i = 1;