in reply to capturing part of a recursive Parse::RecDescent production

For starters, don't use \@item, use [ @item ]. That'll get rid of the weird junk at the end. Then you can flatten the vvalue return as follows:

vvalue : primitive vector_sep(?) vvalue { [ $item[1], @{$item[3]} ] } | primitive vector_sep(?) { [ $item[1] ] }

Your grammar can be optimized to remove unneeded backtracking. Here's a (completely) equivalent grammar:

vvalue : vvalue_(s) { [ map { @$_ } @{$item[1]} ] } vvalue_ : primitive vector_sep(?) { [ $item[1] ] }

Both return:

$result = [ '2', '3', '5', '7', '11', '13', '17' ];