One of the most repetitive work on web applications are the creation of lists of data. Generally all the lists on the application have similar characteristics and same looking. Some time ago i will do all the job by hand on every list, this make me crazy after some dozens of similar lists.

To save some time i create the CGI::List module. This is the result after some years of development and use.

#List
my $list = CGI::List->new(
dbh => $dbh,
sql => {
select => "*",
from => "countries",
limit => "20",
},
);
#Print the list
print $list->print();

Whit this code i have an html list whit auto order and pagination.

Easy i can put a link on each row using the row key as a cgi param.

link => {
key => "id_country",
hidde_key_col => 1,
location => "params.pl",
transit_params => {aditional_param => "param_value"}
},

If you like how sound this, go to: http://www.cgi-list.com to see all the examples.

The CGI::List features are: Columns name autodetection, Auto Order, Auto Pagination, CSS Based, Columns Totals (SUM, COUNT, AVG), Conditional row formats based on a cell value, Conditional cell formats based on a cell value, Http links based on rows key.

In reply to Easy create HTML lists from a database by romdav

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.