Thanks for the quick reply. Your code works as you described and as I requested, but I don't think I explained what I needed very well. Your code creates each series as an element in the array (each line of data is an element), but I need to be able to separate out the PID data in order to work with it. I need the user to log what user was involved, and I need the time to be able to sort the list and choose the 10 "oldest" PIDS for the day. To illustrate, here's the same data:

user1 192.168.1.1 machine1 (v1.1) (flexlmserver/27000 1009), start Sat + 3/30 12:53 user2 192.168.1.2 machine2 (v1.1) (flexlmserver/27000 123), start Sat +3/30 2:45

With your code gives me the output:

$parsed[0] = user1,1009,12:53 $parsed[1] = user2,123,2:45

When I need something like:

@row1 = (user1,1009,12:53) $row1[0] = user1 $row1[1] = 1009 $row1[2] = 12:53 @row2 = (user2,123,2:45) $row2[0] = user2 $row2[1] = 123 $row2[2] = 2:45

So perhaps what I really need is a multidimensional array or a way to split up the file into a grid? My end goal is to take the oldest PIDs so I can run a command on those PID numbers. Therefore I need to associate the time with the PIDs so I can identify the ones I need. You are correct the I am not asking for the correct data construct. Any further suggestions would be greatly appreciated.


In reply to Re^4: Generic Data Collection by Deep_Plaid
in thread Generic Data Collection by Deep_Plaid

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.