neilwatson has asked for the
wisdom of the Perl Monks concerning the following question:

Brother and sisters,

I've been absent from Perl for a while. I'm about to start writing a small CLI program to query a simple (so far) database and generate reports. Years ago I would go to DBI. Is DBI still a good tool? Are there better ways?

And what about formatting output (CLI)? Is there something better than format.

Hi, I don't use dbs much, but I thought that you might find it interesting that Slackware is ditching MySQL in favor of MariaDB.

From the Slackware site:

From today's Slackware -current ChangeLog:
The big news here is the removal of MySQL in favor of MariaDB. This shouldn't really be a surprise on any level. The poll on LQ showed a large majority of our users were in favor of the change. It's my belief that the MariaDB Foundation will do a better job with the code, be more responsive to security concerns, and be more willing to work with the open source community. And while I don't think there is currently any issue with MySQL's licensing of the community edition for commercial uses, several threads on LQ showed that there is confusion about this, whereas with MariaDB the freedom to use the software is quite clear. Thanks are due to Heinz Wiesinger for his work on transitioning the build script, testing, and getting us all behind this move. He's been working with MariaDB (and their developers) for several years now. Vincent Batts also had a hand in the early discussions here -- he met Daniel Bartholomew of MariaDB on a train last year and got a copy of the source to play with to pass the time on the journey (ah, the miracle of thumbdrives :), and was impressed with not only MariaDB itself, but also with the welcome that Slackware was getting. We expect they'll be responsive to any concerns we have. In the vast majority of situations, MariaDB is entirely compatible with existing MySQL databases and will drop right in with no changes required. There's an article available outlining the areas in which MariaDB differs from MySQL that I'd recommend reading:
https://kb.askmonty.org/v/mariadb-versus-mysql-compatibility/

Although your reply is not really a recommendation (fortunately), I cannot resist to place this comparison here. FWIW.

Look at the "Specifications" (=features) for each of the systems.

That lack of features is probably accurate. MariaDB is a young (2007 ?), under-duresse derivative of an already problematically weak system (MySQL), and consequently derives its following mainly from the ranks of the mysql-encumbered (such as, apparently, SlackWare).

Although your reply is not really a recommendation (fortunately), I cannot resist to place this comparison here. FWIW.

Sorry, but that's a crock of shit. MariaDB can only not run unprivileged? PostgreSQL is not open source? MariaDB supports ACID but no referential integrity? If one system supports one datatype that is equivalent to a dozen types of the other's, that counts as negative? I suppose this is auto-generated by a necessarily shoddy parser from marketing blurb and nobody with an ounce of a clue has even glanced at it.

FWIW, this isn't a Slackware-specific move, but is part of a general trend away from inclusion of Oracle-supported MySQL in many Linux distros. Arch Linux has already done this, and last I heard the move was afoot in Debian and Ubuntu as well.

To answer the OP, yes DBI is a great interface for either Postgres or MySQL or MariaDB.

Yes, pretty much everything that people actually use builds on DBI. However, there are a bunch of newer modules that can make your life easier with layers on top of DBI, such as DBIx::Simple (convenience methods for queries, simpler and saner return values, statement caching and such) or DBIx::Class (complete object-relational mapper using abstracted SQL and a whole ecosystem of extensions).
As for databases, it all depends on what you want to do. SQLite has become quite popular for smallish things that don't need much in terms of remote access and concurrency. Its databases live in one easily distributed file and basically create themselves.
Otherwise, yes, Postgres.

For a different approach you may want to have a look at BerkeleyDB. It enables you to tie data structures to a file - there are no database servers to connect to, no SQL to write. There are options for hash, array, queue, heap and Btree, or you can choose your own serialization format for both keys and values, allowing you to store arbitrary data structures. You can do useful things like keep hash keys in sorted order, or have duplicate hash keys sorted by value.

Glade doesn't support Perl. There are some flakey Perl libraries you have to use to produce Perl code, and you have to read the API and write your own code since they dont come as a runable script. Its easier to write the gtk perl code by hand from the XML files Glade produces than figure out how to convert them.

Glade do support perl. See GTK2::Builder module. Its so easy to create and align GUI widgets in Glade (it produce XML file) and write call back in Perl. But, its all personal preference, Should I write Gui code or not.

For code example, Have a look at this: http://code.google.com/p/saaral-soft-search-spider/source/browse/trunk/src/Libs/GtkSpiderGui.pm

When putting a smiley right before a closing parenthesis, do you:

Use two parentheses: (Like this: :) )
Use one parenthesis: (Like this: :)
Reverse direction of the smiley: (Like this: (: )
Use angle/square brackets instead of parentheses
Use C-style commenting to set the smiley off from the closing parenthesis
Make the smiley a dunce: (:>
I disapprove of emoticons
Other