You've got a pretty big task ahead of you,
alligator. I won't do your work for you, but I can give you a few tips for your outline.
- You have to get the HTML page out of the email attachment. I'd recommend to use a MIME parsing tool, such as MIME-Tools
- You'll have to extract the data out of the HTML file, and build a perl data structure (or insert directly into database). HTML::TokeParser::Simple is, IMHO, the most handy approach to tackle that problem.
- You can use Data::Dumper (which comes with perl) to inspect what your built data structure looks like.
- Use DBI to access the database, both inserting data into the database, and for doing the queries. BE forewarned, learning about DBI can take quite a long time... I recommend reading the DBI book. In addition, I like DBIx://Simple, which can reduce the code you need to write to make queries considerably.
- To convert your data back into a report, you can try using blocks consisting of here-docs. Or, you can look into a templating mechanism, like Template-Toolkit (home page, tutorial), or the simpler Text::Template, or even HTML::Template, if you're planning on just outputting HTML.
There, I think that covers the basics, I think.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.