local @array = ($logline =~ /([^\\]+)\\([^\\]+)/g); local %playerinfo; for ($i = 0; $i <= @array; $i += 2) { $playerinfo{$array[$i]} = $array[$i+1]; } print Dumper \%playerinfo;