First of all, this is a bit dicey, and not real "webby," IMHO. Personally, I would just write it to the text box and let them scroll. Ideally, you would write the content to a <p> tag if you wanted to parse it out in chunks.

Second, you can't just assign all the content in the file to an array. How would you keep the value of the array between round trips to the browser? You will probably need to use read to retrieve a predetermined amount of content and then store a counter of where you are in a session key and increment it as the 'Next' link is clicked. On subsequent trips back to your script for more content, you would use the session key to offset the next amount of content from your file.

This is just one way I'm sure, but not real complicated.


—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot

In reply to Re^3: Perl/CGI web page showing data by portions by bradcathey
in thread Perl/CGI web page showing data by portions by vitaly

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.