By publishing this post I try to help people who want to get access to popular and simple database engine sqlite through perl script. I use sqlite to store e-mails statistics at small mail server in order to retrieve information about users’ mail activity like average response time, sent and received messages and etc. There is perl script that is used to get this data per every user or get summary statistics. This script is to be run by web server (I use Apache) and has name index.cgi in my case.
Here is part of it:
#!/usr/bin/perl
use DBI;
print “Content-type: text/html\n\n”;
print “<html><head><title>perl and sqlite example script</title></head><body>”;
$dbh = DBI->connect( “dbi:SQLite:dbname=/tmp/mail_data.db”,”", “”, { RaiseError => 1, AutoCommit => 0 });
my $fst = $dbh->selectall_arrayref(“SELECT min(time_1),max(time_1) FROM mail_data”);
foreach my $row (@$fst) {
my ($fst_pr,$lst_pr) = @$row;
print “oldest entry in database: “.gmtime($fst_pr).” gmt<br>newest entry in database: “.gmtime($lst_pr);
}
print “</body>”;
print “</html>”;
$dbh->disconnect;
After you load this example through any web browser (please read your web server’s manual on how to allow cgi/perl script exec, for example here), script will read sqlite database that is located at /tmp/mail_data.db and display minimal and maximal values of field time_1 from mail_data table.
In order to run this script it’s necessary to install perl, sqlite3 and perl-DBI-SQLite cpan module.
You may also be interested in:
CGI Perl scripts debugging (solve 500 Internal Server Error)
Might be worth posting the database.
Or one you have with sample data.
linuxscrew.com/2007/08/14/access-to-sqlite3-database-through-perl-script-example/
Hello my little friends. I just wanted to say how encouraged I am by your attitude and to see your determination to carry on regardless artist i sense a little sarcasm video cold, picture, Thanks
Nice site! Like you I am a avid motorsport fan, and am also currently very involved in marshalling and race control in our local hillclimbs video so anime metal, film mouth, cartoon, Best Wishes!!
Hi all!!! You are the best!!! Congratulations. film Super site ! artist space, quicktime, Thank you for good job!
Greetings. well sort of clip Perfect site, i like it! news, Kind regards
O, super project. What an amazing story! I was aware of the Goodwood incident, of course, but not of the detail pets Brilliant but simple idea. land result, sale call, puppy crowd, dachshund sugar, collar fun, eclectus, Best regards from regular visitor of your site. ;)
All greetings! I can't be bothered with anything these days. dog Keep up the good work!!! terrier
black, breeder ease, kennel piece, for sale consonant, canine cotton, dog, Good Luck,
Hey, cool tips. I'll buy a bottle of beer to that person from that forum who told me to go to your site :)
O, super project. I speak for all those who wear the uniform of a Marshall when I say that your account made me proud breeder i sense a little sarcasm sale rock, puppies fit, kennel watch, sale, I love it :) Respect !
That was formidable when good some wierd looking lady started to warble like an angel! Susan Boyle was a unaffected astonishment for millions!! WOW!
He put his eye to the hole. He just managed to spy some people sitting in deckchairs chanting, before a finger came out of nowhere and poked him in the eye. As he staggered back, the people started chanting, "Fourteen, fourteen, fourteen..."
Alessandra Ambrosio is so a nice looking. What do you think about she?
had recently herpes virus found in my blood. what I haveto do??? I'm in panic...
my monicker is valerie
found this forum while searching looking for grants.
anticipation i can assist you guys also.
There are so many helpful comments on this site. I just wanted to thank everyone for their insightful comments.
Susan Boyle is an incredibly talented lady who's been subjected to considerable ridicule in the media. IMHO she deserves all of the success that she is experiencing.
I'm surfing internet till I found your website. I'll visit you again.
Anyway, visit me for sometime ^_^
HDTV Buyer Guide
Your site has a very nice design. Morever the material here is free and is of high-quality. I am definitely subscribing to your RSS right now.
???????? «????????» ?????????? ????????????, ????????, ??????????, ?????, ?????????, ??????? ,
???????? ????? ?? ?. 8(495)923-88-40
- <a>
- <a>
- <a>
- <a>
- <a>
? ?????????? ????????? ??????????? ?????? ???? skoda, ???????? ???????? ???????????? ????? ??????? ????????????? ???????? ??????? ????????? ????.
Well, would you look at that..
Hey everyone I’m new here at www.linuxscrew.com. Site looks awesome.
If you want to Watch Mayweather Fight for FREE
This site Watch Mayweather Fight Online has it for FREE
This thing is gonna be bad
Hey very nice Website !! Man .. Beautiful .. Amazing .. I will bookmark your Site and take the feeds also...