(my $timestamp, my $page, my $moredata) = split('\|',$line); #### @$page = (0,0,0,0) if ($$page[3] eq ''); #### $maxCount{'$page'}++; #### foreach my $line (@data) { (my $timestamp, my $page, my $moredata) = split('\|',$line); my @hits = localtime($timestamp); # Here I create and preset an array with a variable name defined by $page my @counters = (0,0,0,0); if ($hits[7] == $now[7]) { $counters[0]++; } if ($hits[4] == $now[4]) { $counters[1]++; } if ($hits[5] == $now[5]) { $counters[2]++; } $maxCount{$page} = \@counters; } my $dAry = ""; my $wAry = ""; my $mAry = ""; foreach my $page (keys %maxCount) { my @counters = @{$maxcount{$page}}; $dAry .= "$counters[0],"; $wAry .= "$counters[1],"; $mAry .= "$counters[2],"; }