There are several approaches that you can use. If you are
using an SQL database for the backend there is the LIMIT
command where you can select exactly just the lines you
want, with offset and length. Please take a look at the
documentation of the database, then...
This has also the advantage that it saves lots of memory and
is quite possibly faster.
If you want to do it in perl and/or don't know if your
database supports the LIMIT selection, you should try with
slices of the aray:
@foo = ("1", "2", "3", "4", "5", "6", "7", "8");
print "@foo[3..6]\n";
This gives you the wanted elements. Don't forget that you
start counting with 0 for the first element (so this returns
the 4th to the 6th element). Thanks to
alakaboo and his
great explenation in
this note :-)
Until you don't go further into
detail about the layout of your database or how you proceed
your data within your perl script I can't offer better
answer (maybe other more enlighened monks can ;)
--
Alfie
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.