Hi PerlGurus, Cheers,

I need your help. I am planning to write a perl script to: I have a big log file where in which there are many lines like:

Starting osci build in ostore_7.4_int_bld.sol2c5.picopt at 2011-09-08- +1702. SUCCESS: Completed osci build in ostore_7.4_int_bld.sol2c5.picopt at 2 +011-09-08-1707. Starting the OSCI build Starting osji build in ostore_7.4_int_bld.sol2c5.picopt at 2011-09-08- +1707. SUCCESS: Completed osji build in ostore_7.4_int_bld.sol2c5.picopt at 2 +011-09-08-1715. Starting xpath build in ostore_7.4_int_bld.sol2c5.picopt at 2011-09-08 +-1715. SUCCESS: Completed xpath build in ostore_7.4_int_bld.sol2c5.picopt at +2011-09-08-1716. Starting ddml build in ostore_7.4_int_bld.sol2c5.picopt at 2011-09-08- +1715. SUCCESS: Completed ddml build in ostore_7.4_int_bld.sol2c5.picopt at 2 +011-09-08-1716. Starting jmtl build in ostore_7.4_int_bld.sol2c5.picopt at 2011-09-08- +1715. SUCCESS: Completed jmtl build in ostore_7.4_int_bld.sol2c5.picopt at 2 +011-09-08-1719. Starting xpath package in ostore_7.4_int_bld.sol2c5.picopt at 2011-09- +08-1719.

I need a script which matches the module names such as osci build, ddml build, osji build, xpath build, etc which has time stamp at the end and store the module name and time in an array and then search for those lines beginning with SUCCESS along the corresponding module names and the time-stamp. Finally give the time difference between the start and complete of the modules. Kindly help.


In reply to search and give the time difference by raghvens

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.