my $p2 = Parse::RecDescent->new(q( hyphen : "-" option : "a" | "b" | "c" Format : Entry(s) Pre : hyphen option Post : option hyphen Entry : Pre | Post { use Data::Dumper; print Dumper \%item;} )); $p2->Format('a-'); $p2->Format('-a'); #### $VAR1 = { 'Post' => '-', '__RULE__' => 'Entry' }; #### $VAR1 = { 'Post' => 'a-', '__RULE__' => 'Entry' }; $VAR1 = { 'Post' => '-a', '__RULE__' => 'Entry' };