But my main goal is to display the average of that calculation...BTW I'm new to perl.
I have a hard time with loops and I just wanted the script to look through the DB and find the instances of "In Production". With the instances found, I would like to find the average of the values in my array $temp1[38] for the row that contained "In Production" and print out the average.