in reply to Log parsing exercises for Perl beginner - reasonable?

Did you help him decode the timestamps at all? That might hang him up. Has he any experience in programming at all?

If not, then something as simple as looping or opening a file could be a novel concept.

Hashes are a great thing to teach, but so are Perlvars in general, as they work quite differently than other programming languages.

--Ray

  • Comment on Re: Log parsing exercises for Perl beginner - reasonable?

Replies are listed 'Best First'.
Re^2: Log parsing exercises for Perl beginner - reasonable?
by Anonymous Monk on Apr 22, 2011 at 13:43 UTC
    Your coworker may not be aware of how powerful regexes are, and may be trying to do a lot of the scan/analysis the hard way. Regex memory is a great tool.

    Does he know about substr?

    And if he's going to be doing much with logs, then an intro to Time::Local would be in order (once he gets his feet under him). Ask him to come up with the average time between log entries w/o writing a time arithmetic routine of his own - instead learn the beauty of timelocal().

    But to answer your question: no, these appear to be a reasonable start to learning Perl.

Re^2: Log parsing exercises for Perl beginner - reasonable?
by mikeraz (Friar) on Apr 22, 2011 at 12:56 UTC

    He has some experience with coding and this is "yet another" attempt to learn Perl. He has demonstrated the ability to loop and open files.

    The timestamps, eg "Apr 14 10:18:22", should present no problem.

    The last time I peeked at his code he was replacing all colons with spaces so he could split on white space and then join the first three fields in the split array.


    Be Appropriate && Follow Your Curiosity