my %log; my $count = 0; open my $fh, '<', $ARGV[0] or die $!; while (<$fh>) { chomp; $count++ if $_ =~ m!"GET\s/index.html!; next if $count < 2; my @data = split /\s/, $_; my $path = $data[6]; my $status = $data[8]; $log{$path} = $status; } close $fh; for my $pragma ( 0 .. 1 ) { for my $cachecontrol ( 0 .. 4 ) { for my $lastmodified ( 0 .. 1 ) { for my $expires ( 0 .. 3 ) { $key = "/img/$expires/$lastmodified/$cachecontrol/$pragma/c.gif"; print $log{$key} || ' - '; print ","; } } print "\n"; } }