Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Modules that significantly contribute to Laziness

by buckaduck (Chaplain)
on May 24, 2005 at 19:30 UTC ( #460141=note: print w/replies, xml ) Need Help??


in reply to Modules that significantly contribute to Laziness

This depends on how you set up your application, but when I have a web-based application with a database backend, I often use Data::Table for maximum laziness. After performing a database query, you can filter, sort, reformat, etc. and then print the resulting data as an HTML table. There are plenty of options for formatting the HTML table nicely.

A lazy example (based on the module's documentation):

use Data::Table; use DBI; my $dbh= DBI->connect("DBI:mysql:test", "test", "") or die $DBI::errstr; my $minAge = 10; my $t = Data::Table::fromSQL ( $dbh, "select * from mytable where age >= ?", [$minAge], ); # Print out an HTML Table. print $t->html;

buckaduck

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://460141]
help
Chatterbox?
[erix]: I saw a common kingfisher and a couple of bullfinches
[erix]: bullfinch ( a male and a female )
erix learned the word 'portaging' not so long ago (from vikings lugging their ships from one river-system to another)
[choroba]: my best run so far
[erix]: I think they build a portaging installation for yachts here not so long ago - lemme google it
[erix]: choroba ah, you should have sprinted 7 s off that :)
[erix]: (but then there's always a next (im)possible goal)
Corion avoids running by starting on time
[choroba]: my phone showed me 1 hour 10 km which was my goal, it changed a bit after uploading to the website

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2017-05-24 12:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?