Hi, I'm currently placing a log record as a string, for example
my $SentRec; open(LOGFILE, "$LogDir$Filename") or return "Error: Open of $Filen +ame failed: $!\n"; while (<LOGFILE>){ if (/\b$Autosys/) { print "the full string: $_\n"; $SentRec = substr($_, 0, 28); $count++; } #sample output 07/25/05 09:03:56 p2.ipgprd.nscc.bti.arch.d Archived BTIHDR.000.137660 +435.Z 07/25/05 09:04:11 p2.ipgprd.nscc.bti.arch.d Archived ML2001788C.137660 +435.Z 07/25/05 09:04:37 p2.ipgprd.nscc.bti.arch.d Archived ML2001789D.137660 +435.Z
and I'm using the timestamp (last one) further on in the program.

What I would like to do is use the first and last time now, so I thought place them into a hash instead, but when I looked at perl hash, I found about 6-8 different types and I'm completly lost as to which variant to use.

I thought I could store them per key and then use the first and last value per key as the two values required, but haven't been able to figure out how to populate the hash yet :(

tia,

In reply to Perl Hash by TechNoFear

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.