As irah said, processing the document line by line could be a good idea. But there's probably no problem with doing otherwise.

A Perl "trick" you may find useful is changing your script definition of what a line is, for exemple you could read your input file paragraph by paragraph instead of line by line, if a single line isn't enough information for you to work with. Check the documentation on $/ for that. For example, if your paragraphs are separated by a ----- line you could write :

{ local $/ = "\n-----\n"; # We make sure to localize the reading behav +iour to the inner block while(my $paragraph = <$yourInputFile>) { # code that processes the data } } # At this point we go back to a normal reading behaviour

In reply to Re: Big paregraphs in Perl by Eily
in thread Big paregraphs in Perl by uajith

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.