|Perl: the Markov chain saw|
Re: Quoted Text rule for Parse::RecDescent?by ikegami (Pope)
|on Aug 23, 2005 at 17:18 UTC||Need Help??|
Keep in mind the last item in the production is the one that determines the returned value of the entire production.
Also keep in mind that extract_quotelike behaves different in list context compared to scalar context.
The following will do the trick:
Of course, that leaves the quotes in. If you want to remove the quotes, the following will work:
Fortunately and unfortunately, it doesn't parse `, q, qq, s, tr, y and here-docs like extract-quotelike. If you want it to parse any or all of those, reply to this node and I'll provide.
By the way, don't use $_ without localizing *_ or at least $_ first. You risk clobbering something in the caller. (for/foreach localize this for you, but not while.)
Update: I pretty much rewrote this node a few times, trying to make my thoughts coherent.