I wish I was more savy as to pose this question in a way that is more clear but let me try to explain. I have a data file that consists of binary data with an ascii based header applied to the beginning of the binary data. When the data is ultimately used the (routing) header is removed and the binary data is written out to file. I am wanting to refine our data management process and improve a file processing daemon which currently is painfully slow. I was trying to find the best way to read in the data file WITHOUT reading in the whole file and without depending on system based commands like "head". Some of the files are in excess of 30 Megs and all I care about are at most the first 13-18 lines within the file. The end of the header is denoted by a END text string (go figure). Ideally I would like to read the file from the beginning up until this "END" string and then close the filehandle so that I can process the data file based on this ascii header content. Any advice on how I can tackle this or even what modules might benefit my endeavors would be appreciated. My searches at this point have been fruitless. Thanx in advance, MadPogo ~~ What does not kill me makes me stronger, right?

In reply to Reading a Filehandle by line or by stream by MadPogo

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.