I am trying to simplify the following code:
Playing with something like:
Cheers
Code:
my $ticTotStart = 0;
my $ticTotOpen = 0;
my $ticTotClosed = 0;
my $ticTotEnd = 0;
my $ticTotTotal = 0;
my $ticTotChanges = 0;
my $ticTotTelco = 0;
my $ticTotPower = 0;
my $ticTotServer = 0;
my $ticTotApp = 0;
foreach (@ticTblDeref) {
my ($ticTblTier,$ticTblSev,$ticTblType,$ticTblStart,$ticTblOpen,$ticTblClosed,$ticTblEnd,$ticTblTotal,$ticTblChanges,$ticTblTelco,$ticTblPower,$ticTblServer,$ticTblApp) = split (/,/);
($ticTotStart += $ticTblStart);
($ticTotOpen += $ticTblOpen);
($ticTotClosed += $ticTblClosed);
($ticTotEnd += $ticTblEnd);
($ticTotTotal += $ticTblTotal);
($ticTotChanges += $ticTblChanges);
($ticTotTelco += $ticTblTelco);
($ticTotPower += $ticTblPower);
($ticTotServer += $ticTblServer);
($ticTotApp += $ticTblApp);
}
print OUT "Total,,,$ticTotStart,$ticTotOpen,$ticTotClosed,$ticTotEnd,$ticTotTotal,$ticTotChanges,$ticTotTelco,$ticTotPower,$ticTotServer,$ticTotApp\n\n";
Playing with something like:
Code:
my %ticHash = ();
foreach (@ticTblDeref) {
$ticHash{$_}
Cheers