#!/usr/local/bin/perl5 -wT print "Content-type: text/html\n\n"; use Date::Calc qw(Delta_Days); @Months = ('1','2','3','4','5','6','7','8','9','10','11','12'); ($Month_Day,$Month,$Year) = (localtime)[3,4,5]; $Year += 1900; open(HANDLE,"../script_integration_data/script_integration_records"); while () { @temp1 = split(/:/); $domain = unpack ("A4", $temp1[40]); $day_diff = Delta_Days($temp1[28], $temp1[30], $temp1[29], $Year, $Month, $Month_Day); if (($domain eq "BBA") && ($temp1[36] eq "In Production") && ($day_diff <= 90)) { $sum += $temp1[38]; $count++; } } close(HANDLE); $average = $sum / $count; if ($average >= 44) { print sprintf "%.f days", $average; } elsif (($average >= 11) && ($average <= 44)) { print sprintf "%.f days", $average; } elsif ($average <= 10) { print sprintf "%.f days", $average; } # EOF