Forgive me if I'm not much help. I'm pretty tired and I have work to do so I can't spend long on it...

I didn't think about the fact that the records would have different number of lines in them. Am I ok to assume that the first part of the records will all be the same and just have an optional number of sub-recrods (Options)? If so, then are you wanting to save the Option records? If not, then just remove the last like I said and you should be ok (since the while(<FILE>) will slurp up all the Option records as well as the "End Product" and ";" lines; ie: the if block won't match). If you did want to save the Option records, you'll have to put a sub-while loop in just before the push to read in all the Option records. It should have similar logic to the outter while loop.

That said, I'm not sure this is the best way to go about this. I don't really like reads inside the if block because you're not doing any EOF checking on them and you're usurping control from the while. I think you might be better off going with Trimbach's suggestion or, perhaps even better (depending on how you implement it), DeaconBlues' method, both of which use $/, though DeaconBlues' use of it actually make more use of it. (Okay, that last bit didn't make much sense but, like I said, I'm sleepy.)

Anyway, sorry I couldn't help more. Hope you get it. Gotta work. =(

bbfu
Seasons don't fear The Reaper.
Nor do the wind, the sun, and the rain.
We can be like they are.


In reply to (bbfu) Re(7): how to hash this by bbfu
in thread how to hash this by malaga

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.