Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Adding variables to Spew grammar
by ikegami (Patriarch) on May 05, 2005 at 01:55 UTC | |
|
Re: Adding variables to Spew grammar
by davido (Cardinal) on May 05, 2005 at 02:21 UTC | |
|
Re: Adding variables to Spew grammar
by NetWallah (Canon) on May 05, 2005 at 04:03 UTC | |
|
Re: Adding variables to Spew grammar
by merlyn (Sage) on May 05, 2005 at 11:07 UTC | |
|
Re: Adding variables to Spew grammar
by Anonymous Monk on May 05, 2005 at 03:09 UTC |