I'm going to post a snip of the main loop for my Arcserve parser, mostly because I catch some of the weird things that pop up in our logs. Errors that start on a seperate line is one that tripped me up bad. These might help you if you run into them in your logs:

#%jobentry is defined outside of the while loop while (<LOG>) { next if /^\n/; my %line; my ($date, $time, $jobinfo, $jobtext); chomp; if (/^(E\d{4})/){ $jobtext .= "[$1] "; $_ = substr $_, 6; }elsif (!/^\d{8}/){ my $tmp_count = $count - 1; $job_entry[$tmp_count]{'text'} .= $_; next; } $date = substr $_, 0, 8; $time = substr $_, 9, 6; $jobinfo = substr $_, 16, 6; $jobtext .= substr $_, 23; #o_trim is a little sub for taking out any straggling whitespace in th +e job description $jobinfo = o_trim($jobinfo); #Go on with rest of loop. I push the data into a hash, and then push t +he hash into a database structure after I gather an entire job's wort +h of entries. }

The entire code is tested and works, if quite quirky, as I was playing with some ideas about data structures when I did it. I'll post it if there is any interest.

----Asim, known to some as Woodrow.


In reply to Re: Monk Specs.? by Asim
in thread Monk Specs.? by draper7

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.