The answer to your question very much depends on what sort of information you need to extract from the email. If you are merely extracting and testing standard fields in an email, there are som 130+ CPAN modules at your service. Surely at least one of them will have something you can use. (see http://search.cpan.org/search?m=dist&q=Email&s=1)
If you are trying to parse the body of the email as well, then the answer would depend on how the body of the mail is formatted. If it is a standard format (.ini, CSV, XML, HTML, YAML, etc), there is most likely a Perl module specifically for that format and you would be reinventing the wheel. If it is non-standard, the choice of parser depends on the grammar - it might be over kill, it might be just right, or it might just not fit the problem. Not every grammar can be parsed efficiently with Parse::RecDescent.
As for suggesting a grammar? The first step is describing the grammar in plain English and writing out some examples for yourself. Then you can work on converting the rules into the format needed by Parse::RecDescent or any other parsing tool you choose. The time to ask for help is after you've made a first pass on your own. Show us what you tried and we'll be glad to help clean up syntax problems or questions about how to represent some particularly troublesome formatting rule.
There are some great tips on how to be more exact in raising a question here: How (Not) To Ask A Question Please take the time to read it: We'd like to help you, but we can't read your mind or intuit your text formats and business rules off of a white board in your office.
Best, beth
In reply to Re: Parse::RecDescent question
by ELISHEVA
in thread Parse::RecDescent question
by fionbarr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |