is there a way to read a file not line by line because i want to loop through stuff w/o using variables but i have to find the right data in the file, and the data are separated by a boundry expression, but the boundaries for each peice of data are on different lines(togh). What im doing now is saving the file to an array by lines then turning the array into a string and then search the string for the boundries and save the stuff between and later print. I would like to find a way without saving the whole file into an array but because i need to find sruff on diff lines i cant loop through it.SORRY THIS IS REALLY HARD TO UNDERSTAND SO HERE IS A SUMMARY. I want to loop through data in a file but need to find data in multiple lines.EXAMPLE
file.txt 111****222222222222 22222222222****333333333333333 333333333333333**** so on and so on endfile.txt
what could i do to save the 1s 2s and 3s in an array without saving the whole file to an array line by line, then turning it into a string and then match and push the data onto an array?

In reply to reading a file by maddfisherman

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.