my $grammar = <<'END_OF_GRAMMAR'; #Start up action(executed in parser namespace): { use 5.012; #So I can use say() } startrule : from_clause from_clause : 'from' dir(s) { say "-->$_<--" for @{ $item{'dir(s)'} }; } dir : m{\S* / \S*}xms END_OF_GRAMMAR my $parser = Parse::RecDescent->new($grammar); $parser->startrule("from ./hello hello/world"); --output:-- -->./hello<-- -->hello/world<--