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.
For output, have a look at Text::Autoformat and Text::Template