You are right, %item has either the Pre or Post matching part. But only in one case does it print anything!
Entry : Pre | Post { use Data::Dumper; print Dumper \%item;} # is equivalent to Entry : Pre Entry : Post { use Data::Dumper; print Dumper \%item; } # is equivalent to Entry : Post { use Data::Dumper; print Dumper \%item; } Entry : Pre # is NOT equivalent to Entry : Pre { use Data::Dumper; print Dumper \%item; } Entry : Post { use Data::Dumper; print Dumper \%item; }
And the last example is what you want
In reply to Re^3: Parse::RecDescent grammar definition
by jethro
in thread Parse::RecDescent grammar definition
by citromatik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |