Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
foreach (<LOGFILE>){ #my @ddata; #4 if (/^(.*?)*(.*?)*(.*?)*(.*?)*(.*?)*(.*?)*(.*?)*(.*?)$/gi){ #prin +t starting at the date push (@logg,$1); } } my %count; my $total_count; foreach my $element( @logg ) { #4 ++$count{$element}; $total_count++; } #Sort hash by its values foreach my $element (sort {$count{$a} <=> $count{$b}} keys %count){ print "Name: $element<font color=red size=\"2\">Shows:<b>$count +{$element}</b></font> times.<br>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing Log File Help!
by Enlil (Parson) on Apr 14, 2004 at 19:54 UTC | |
|
Re: Parsing Log File Help!
by pbeckingham (Parson) on Apr 14, 2004 at 20:03 UTC | |
|
Re: Parsing Log File Help!
by blue_cowdawg (Monsignor) on Apr 14, 2004 at 20:10 UTC | |
by Anonymous Monk on Apr 15, 2004 at 10:17 UTC | |
by gsiems (Deacon) on Apr 15, 2004 at 15:14 UTC |