in reply to scope issues in Parse::RecDescent

my $p6 = Parse::RecDescent->new(q( letter : /\w/ character : letter Format : character(s) )); my $x= $p6->Format('abc'); die "Invalid pattern" unless (defined $p6); print Dumper $x; #prints $VAR1 = [ 'a', 'b', 'c' ];

Be careful to specify what a rule returns with $return if more than one production is in a rule (i.e. with a rule like "strangeword: character number character(s)", since only the last production is returned as a default

With $return you can also return anything you want, i.e. parsed and interpreted commands, hashes, objects ...