These days I think if you want to use other people's clean code, you must accept modules. This will require more than one file.

My log file analyzer makes very nice graphs using R. In addition, having the data in R makes it easy to do statistical analysis. If R is anything, though, it is not simple!

One of the hardest things to do well in logfile analysis is to properly parse the default Apache log file. It is easy for users to type in weird URLs that break most parsers for common log formats. It is much easier to modify the log file format to eliminate this possibility than it is to write a parser to fix this problem.

If the web server stores the log data that is actually needed in a bullet-proof way, it is easy to meet your requirements in just a few lines of code. Who wants to parse dates? Just store seconds since the epoch. How about some decent delimiters? Whitespace is not always the best choice!

It should work perfectly the first time! - toma


In reply to Re: [OT] Simple access_log analyzer in Perl by toma
in thread [OT] Simple access_log analyzer in Perl by Jaap

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.