#!/usr/bin/perl

###
### A program to calculate the lines per hour for snare
###
###
###


@log=`cat samplelog.log`;

foreach $line (@log) {
chomp($line);
undef(@parts);
@parts=split(/\,/,$line);

foreach $part (@parts) {

#print "\npart is :$part:";

if ($part =~ /2004/) {
($day,$month,$day,$time,$year)=split(/\s+/,$part);
#sample Mon Oct 25 07:40:00 2004
#	print "\n date $part"
($hour,$minute,$second)=split(/:/,$time);
#	print "\n time $time"
$key=join(/_/,$hour,$minute);	
#print "\nkey is $key";
	};
$linecount{$key}++;
if ($lastkey =~ /$key/x){
}else {
$lastkey=$key;
print "\n linecount $key is $linecount{$key}";
}

}

}
