my $parser = Parse::RecDescent->new($grammar) or die "Bad grammar!\n"; defined $parser->startrule($text) or die "Can't match text"; #### startrule: brace_block(s) #adjustment brace_block: lbrace(1..) 'hello' lbrace: / [{] /xms rbrace: / [}] /xms #### startrule: startrule: lbrace(s) { my $lbraces = join '', @{$item[1]}; $rbraces = "}" x length $lbraces; } 'hello' "$rbraces" lbrace: / [{] /xms #### Can't use string ("{{") as an ARRAY ref while "strict refs" in use at (eval 14) line 377