Help for this page

Select Code to Download


  1. or download this
    while (<LOG>) {
        my @part = (split ' ', $_)[5,8]; 
        $hash{$part[0]}->[0] ++;             # increase the count. 
        $hash{$part[0]}->[1] += $part[1];    # increase the sum.
    }
    
  2. or download this
     
    for my $key (sort keys %hash) {
        my $avg = $hash{$key}->[1] / $hash{$key}->[0];    # sum/count.
        print "$key\t$avg\n";  
    }