#!/usr/bin/perl -w use strict; my ($curlir, $allocs); open (INPUT, "alloclist.txt"); while () { $curlir = $1 if (/^(\w{2}\.\w+)\s*$/); next unless (/^\s*\d{8}\s+([0-9.]+)\/(\d+)\s+/); $allocs->{$curlir} += 2**(32-$2); } foreach my $key (sort {$allocs->{$b} <=> $allocs->{$a}} keys %{$allocs}) { print "$key: $allocs->{$key}\n"; } close (INPUT);