Keep It Simple, Stupid | |
PerlMonks |
How to calculate earliest date from log fileby jaffinito34 (Acolyte) |
on Nov 10, 2012 at 21:46 UTC ( [id://1003282]=perlquestion: print w/replies, xml ) | Need Help?? |
jaffinito34 has asked for the wisdom of the Perl Monks concerning the following question: I'm working on a script where I'm given a log file and need to print some of its info to an HTML file. One problem I'm having is that at the top of the HTML file, I need to print the start of the log date, which will be the earliest date found in the log. I believe I need to implement this in my while loop but I'm not sure how it will work. Here's my code:
Just for reference, here is an example of what is found in the log file 66.249.65.107 - - 08/Oct/2007:04:54:20 -0400 "GET /support.html HTTP/1.1" 200 11179 111.111.111.111 - - 05/Oct/2004:15:17:55 -0400 "GET / HTTP/1.1" 200 10801 111.111.111.111 - - 06/Oct/2007:11:17:55 -0400 "GET /style.css HTTP/1.1" 200 3225
Do I need to convert the date somehow so I can compare them? Or can I tell perl to just check certain parts of the variable? All suggestions are welcome.
Back to
Seekers of Perl Wisdom
|
|