|Perl Monk, Perl Meditation|
Re: Creating Moose Classes to Interact with mySQL/Oracleby stvn (Monsignor)
|on Feb 22, 2011 at 14:56 UTC||Need Help??|
I would suggest DBIx::Class, Fey::ORM or Rose::DB::Object. They are all excellent modules, fully OOP and all will do everything you want and more, allowing for your application to grow. However, if you feel you want to write this from scratch here are a few CPAN modules you will want to look at.
1. connect/disconnect to/from oracle/mysql database.
Obviously you need DBI, but I also recommend using DBIx::Connector to manage your DB connections, it is battle tested code that has been extracted from DBIx::Class and will just make your life easier.
2. query tables and return data.
You really don't need anything more then DBI to do this, but you might want to look at Fey and in particular Fey::SQL as it is a nice way to manage your tables and have proper SQL generated for you. To make things a little easier when querying, you can take a look at FeyX::Active, which just wraps Fey::SQL (see the SYNOPSIS for details)
3. process data and create relevant html reports.
Well you will probably want Template to do HTML templating to create your reports with, and if you need to do any charts or graphs, I highly recommend Chart::Clicker. For data processing, well that is what Perl does best, but you might want to check out a few really useful CPAN modules like List::AllUtils and Data::Visitor::Callback.