#!/usr/bin/perl use warnings; use strict; # open file my $file = shift @ARGV; open (FILE1, "<", $file) or die "Can't open '$file': $!"; # read file into an array my @data = ; # close the file you don't need it any more close (FILE1); # Use a FOREACH loop to read through the data in the array foreach my $caseMetrics (@data) { (my $caseOwner,my $caseNumber,my $accountName,my $contactName,my $openedDate,my $subject,my $status,my $priority,my $severity,my $ageHours,my $caseOrigin,my $closedDate,my $highWaterMark,my $accountRegion,my $industryConcentratio,my $industry,my $apiType,my $applyFromApp,my $environmentAffecting,my $osBackend,my $osFrontend,my $version, my $maintenanceLevel)=split('\t',$caseMetrics); #Calculate the number of total cases. sub total_cases{ my @closedCases = $caseNumber; my %caseCount; map {$caseCount{$caseNumber}++} @closedCases; return %caseCount; } }