Access to sqlite3 database through perl (script example)

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.

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.

Hiya, I am really glad I've found this info. Today bloggers publish only about gossip and web stuff and this is actually annoying. A good blog with interesting content, that is what I need. Thank you for making this site, and I'll be visiting again. Do you do newsletters? I Cant find it.

Hello People! Just wanted to tell you that I found tickets to the Jersey Boys concert on Nov 24th. In this site you can find tickets for other dates too. It's astonishing their performance on stage, this is my fourth time and I'm still so excited about listening them live! On this page you can see the section where you're buying the ticket, so it's very recommended!

Hello People! Just wanted to tell you that I found tickets to the Usher concert on May 18th. In this site you can find tickets for other dates too. It's wonderful Usher and his crew performance, this is my third time and I'm still so excited about listening him live! On this page you can see the section where you're buying the ticket, so it's very recommended!

Artem is systems engineer for more than 7 years and holds broad experience in Linux, Unix, Cisco systems administration. Feel free to get in touch with Artem Nosulchik via Google Plus, Twitter or Facebook.

LinuxScrew Recommends

Who’s behind LinuxScew?

My name is Artem Nosulchik, I'm part time blogger and full-time Linux sysadmin. In 2007 I started LinuxScrew to share my personal notes on anything related to Linux and Open Source on the whole and found this pretty interesting.