Solve almost any datetime need with Time::Piece
How to parse, print, format, compare and do math with datetimes in Perl
How to parse, print, format, compare and do math with datetimes in Perl
Imagine yourself in a meeting with management. You’re about to begin your third attempt to explain how to process online credit card payments. After a couple of sentences, you see some eyes glazing over. Someone says, “Perhaps you could…
As a Perl beginner, I wrote many scripts that created text files to store snippets of data. Eventually I had hundreds of little text files in a data directory, each one holding one piece of information in the form…
For the last several years, there has been more and more emphasis on automated testing. No self-respecting CPAN author can post a distribution without tests. Yet some things are hard to test. This article explains how writing Test::Files gave…
Previous Perl.com articles have reviewed where Bricolage fits into the universe of content management systems and worked through Bricolage installation and Bricolage configuration. Now it’s time to go through the steps required to model the structure of an existing…
Prelude How do you test DBI programs: Without having to modify your current program code or environment settings? Without having to set up multiple test databases? Without separating your test data from your test code? With tests for every…
This article is a case study of the use of Perl and XML/RDF technologies to channel disparate sources of data into a semi-structured repository. This repository helped to build structured OLAP warehouses by mining an RDF repository with SAX…
Having almost achieved the state of perfect laziness, one of my favorite modules is Class::DBI::mysql. It makes MySQL database tables seem like classes, and their rows like objects. This completely relieves me from using SQL in most cases. This…
Testing code that uses a database can be tricky. The most common solution is to set up a test database with test data and run your tests against this. This, of course, requires bookkeeping code to keep your test…
The expression “Embedded Database” requires an explanation. A “database” is an application that allows the targeted retrieval of stored data - a log-file is not a database. By “embedded” I mean a database that does not run in a…
One of the best ways to make your Perl code look more like … well, like Perl code - and not like C or BASIC or whatever you used before you were introduced to Perl - is to get…
When you woke up this morning, the last thing you are likely to have thought is “If only I had a dictionary!” But there are thousands of languages on Earth that many people want to learn, but they can’t,…
One of my favorite things about Perl is how flexible it is. When I don’t like something about the language, I don’t let it get me down. I just change the language! The secret to doing this lies in Perl…
One of the common Perl idioms is processing text files line by line: while( <FH> ) { do something with $_ } This idiom has several variants, but the key point is that it reads in only one line…
An Embarrassing Confession I’d like to think that I’m a reasonably decent Perl programmer now. I’d like to think that I have a good grasp of how to solve relatively common problems in Perl. But, you know, it hasn’t…
It’s quite possible to end up with digital music files that don’t have good information about what they are. Files that don’t have ID3 information can rely on paths for album information, for example, and that is lost easily. M3U…
Introduction to Searching Usually, when building an application, a lot of thought goes into how the data is entered and updated, rather than finding it again. Finding data is an afterthought, especially when developing with a small dataset. If…
Several articles on Perl.com, including the recent Phrasebook Design Pattern, have discussed the problems faced when writing Perl code that interacts with a database. Terrence Brannon’s DBIx::Recordset article attempted to show how code dealing with databases can be made…