Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I'm assuming you only need to count the number of hits as you say, not list them as you have done in your example.
First you need the string for yesterdays date. This is one way but there are others....
There are other and better ways using libraries such as Date::Calc to do the same thing.
Number of lines returned is the number of hits on your site. This command can be run inside a Perl script inside backticks. However, the grep command exists in Perl too, so just read the file into an array and use the Perl grep command, as in scalar context it returns the number of matches.
A Monk aims to give answers to those who have none, and to learn from those who know more.
In reply to Re: counting yesterdays hits in a logfile
by space_monk
|
|