hi fella's, i'm a newbie so pls. forgive me for asking dumb questions. i want to randomly display images into HTML files. but what i want is to read the files sequentially not randomly. here is my data file that my CGI script reads.
1|/images/banners/internal/image1.gif|http://www.blah.com 2|/images/banners/internal/dumb.gif|http://www.dumb.com 3|/images/banners/internal/perl.gif|http://www.perl.com 4|/images/banners/internal/slashdot.gif|http://www.slashdot.org 5|/images/banners/internal/linux.gif|http://www.linux.org 5|/images/banners/internal/apache.gif|http://www.apache.org 6|/images/banners/internal/bsd.gif|http://www.bsd.org 7|/images/banners/internal/penguin.gif|http://www.penguin.com
now my script should run like this via IMG SRC tag.
<img src="/cgi-bin/showad.cgi?type=internal&begin=1&end=3"> <img src="/cgi-bin/showad.cgi?type=internal&begin=4&end=7">
the first IMG SRC tag runs the script showad.cgi and with the "begin" parameter having the value 1 and "end" parameter having the value "3" means that the script will pick the lines 1 to 3 from the above data file and print them randomly. same with the next IMG SRC having "begin" parameter with value 4 and "end" parameter 7 means that the script will begin at line 4 to 7 and randmly displays the image to the HTML file. i know you could help me on this guys. thanks in advance.

In reply to picking x numbers of lines from a file by damian

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.