So that a possible output would be - Matt sails. But "Matt" just comes out empty. Any ideas how I might accomplish this? It would be cool to have the user input names that are then added to the grammar before it's compiled. Thanks so much!$foo = "Matt"; use Inline Spew => q{ START: sentence sentence: person " " action "." person: "$foo" | "She" | "Barnacle Bill" action: "walks" | "sails" | "swims" }; print spew();
In reply to Adding variables to Spew grammar by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |