I am going to attempt to create a Perl script to handle calculating reoccurring call statistics for an inbound call center. I am very new at Perl and am hoping to use all of you fine people as a sounding board to make sure I am going down the right path.
Each day a table is created in a SQL Database with that days call information. The table naming convention is "inboundlogMMDDYY".
On the first of every month I plan on running a cron job that will calculate the number of days in the previous month, the month, and the year. In an attempt to gather enough information to populate a SQL statement to grab the data from each days table for the given month and populate it in a new temporary table that will hold the entire month’s data.
Once this new temporary table is populated with the month’s data, I will be calculating statistics like, average hold time, average talk time, and the number of abandoned calls. All the data for such statistics are in the data set.
This calculated information will be saved out to either a text file or HTML formatted file. This file will in turn be emailed out to the correct entities.
I have in the past been able to craft SQL statements in Perl using the Perl|DBI and also send emails from Perl, so those two items don't scare me much.
But creating a loop that will iterate through the number of days in a month and populate that value in to an SQL statement does scare me...
Before anyone asks about doing all this inside of SQL itself, I am using a version of Informix that is at least 15 years old and as such only supports the very basic of SQL statements.
Any insights you fine people might have a greatly appreciated. As always, sample code is next to godliness.
FeiLung