I'm having mental block today... forgive me. I had a workaround to this once, but can't remember what I did (I know -- terrible).
I've tied a file. I go through the file, and find the line I want. Problem is -- the timestamps are on other lines. Also, it's not a specific # of lines away from the line that has my info so simply adding X to the index and grabbing the timestamp won't work.
So, I basically need to go through each line in the array. When my condition returns true, I need to then start ANOTHER loop, and go until I find a timestamp. Now, the kicker... how do I exit this second loop once I hit a timestamp?
I can always let it run through like the next 500 lines (it would surely find one there) and then only take the first timestamp I find, but that's horribly inefficient me thinks.
Thanks
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.