Logfile Example "ct1<4><>" entered the game "ct1<4><>" joined team "CT" "terror1<1>" attacked "ct1<4>" with "p228" (damage "26") (damage_armor "0") (health "74") (armor "0") "terror1<1>" attacked "ct1<4>" with "p228" (damage "27") (damage_armor "0") (health "47") (armor "0") "terror1<1>" attacked "ct1<4>" with "p228" (damage "27") (damage_armor "0") (health "20") (armor "0") "terror1<1>" attacked "ct1<4>" with "p228" (damage "28") (damage_armor "0") (health "-8") (armor "0") "terror1<1>" killed "ct1<4>" with "p228" "ct1<4>" attacked "terror2<2>" with "fiveseven" (damage "12") (damage_armor "2") (health "88") (armor "98") "ct1<4>" attacked "terror3<3>" with "fiveseven" (damage "13") (damage_armor "0") (health "2") (armor "0") #### # kill / killed logging # $1 = killer # $2 = killed # $3 = weapon used if($_ =~ m/^"(.+)<.+><.+><.+>" killed "(.+)<.+><.+><.+>" with "(.+)"/){ $players{$1}{"frags"} += 1; $players{$2}{"deaths"} += 1; } #### # The skeleton of each player hash my %skeleton_player = ( "team_side" => "0", "frags" => "0", "deaths" => "0", "suicides" => "0", "dmg_done" => "0", "dmg_received" => "0", "team_damage" => "0", "team_kills" => "0", ); my %players = (); my @file = <>; foreach(@file){ # Deletes the time information from each log line $_ =~ s/L [0-9]+\/[0-9]+\/[0-9]{4} - [0-9]+\:[0-9]+\:[0-9]+\: //g; # Creates a hash of a hash for players # # And Copies %skeleton_player to it # # %players # - %player 1 # -frags # -deaths # -etc.. # - %player 2 # -etc.. if($_ =~ m/"(.*)<.*><.*><.*>" entered the game/){ unless(exists $players{$1}){ $players{$1} = %skeleton_player; } }