#!/usr/bin/perl

my %URLS;

# Parsování httpd logu, vytištění nejžádanějších URL
while (<>) {
	chomp;
	my ($host, $ident, $user, $date, $command, $status, $length) =
		/^(.+?) (.+?) (.+?) \[(.*?)\] "(.*?)" (\d+|-) (\d+|-)/;
	
	$URLS{$command} += $length;
	## print "$host $command\n";
	}
my $i = 0;
for my $key (sort { $URLS{$b} <=> $URLS{$a} } keys %URLS) {
	print "$key $URLS{$key} \n";
	$i++;
	last if $i >= 10;
	}
