#!/usr/bin/perl -w use Data::Dumper; use switch; my $file = "C:/Programme/UrbanTerror/q3ut4/games.log"; open ( FILE, $file ) or die ("Cannt open File $file"); while (defined(my $line = )) { if ($line =~ /^\s+(\d{1,2}:\d{2}) ((\w+):(?: )?(.*)?)/) { my $time = $1; if (defined ($3)) { if (defined ($4)) { if ($3 eq "ClientConnect") { &ClientConnect($4); } if ($3 eq "ClientBegin") { &ClientBegin($4); } if ($3 eq "ClientUserinfo") { &ClientUserinfo($4); } } } } } sub ClientConnect { local $id = shift; # print ("Client $id connected\n"); return 1; } sub ClientBegin { local $id = shift; # print ("Client $id began\n"); return 1; } sub ClientUserinfo { local $line = shift; if ($line =~ /(\d+) \\(.*)/) { #print "Client $1: $2\n"; # HIER SOLL local $logline = $2; local @array = ($logline =~ /([^\\]+)\\([^\\]+)/g); local %playerinfo; for ($i = 0; $i <= @array; $i += 2) { $playerinfo{$array[$i]} = $array[$i+1]; } print Dumper \%playerinfo; # %playerinfo = $logline =~ m! /([^/]+)/([^/]+)/ !xg; # print Dumper \%playerinfo; die(); } return 1; }