First some style/structure comments:
next unless /Synchronizing started|Synchronizing finished|Summary/; my @date= m|(\d+)/(\d+)/(\d+)|;
I would make sure that you check that the date regex matched before using @date. Something like:
my @date; if (@date = m{(\d+)/(\d+)/(\d+)}) { ... }
The danger is that if the date regex fails, you will have no way of knowing about it. (Update: I guess this is not entirely true, but it is still good coding practice to always test if regex matches succeed or not.)

The next issue is: never mind... I didn't see how @today was defined

Here's what I think you want:

my %times; my $job; while (<FH1>) { next unless (s{^\[(\d+/\d+/\d+ \d+:\d+:\d+)\]\s*}{}); # malformed li +ne my $timestamp = $1; if (m/^(Synchonization|Analyzing) (started|finished), job: "(.*?)"/) + { $job = $3; $times{$job}->{$1}->{$2} = $timestamp; } elsif (m/^Summary:/) { $times{$job}->{summary} = $_; } } print Dumper(\%times); use Data::Dumper;
One key element of this loop is to save the last parsed job so we know which job a "Summary" line refers to. The list of jobs is keys %times.

There are other ways of storing the timestamp data, and you may want to choose another data structure depending on how you plan to use the data later.


In reply to Re: Unique Data Formatting by pc88mxer
in thread Unique Data Formatting by raj8

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.