My first module: Data::Compare::Plugins::Set::Object

I wrote Data::Compare::Plugins::Set::Object (blech, what a mouthful) a couple months into my job at GSI. At the time I wasn't sure what if any their policy was on open source releases, so I was careful to do it on the side and assign copyright to myself. I still haven't found an explicit policy beyond my manager's "just use your best judgment" statement. Maybe that's for the best.

It's a tiny tiny little module (less than 40 lines of code) that does a tiny tiny little thing (compare deep data structures while doing correct comparisons for unordered sets). Its main significance to me was that it exposed me to all the necessary but not difficult work of packaging up a distribution for CPAN, including documentation, tests, metadata and an installer. I went with Module::Install for the latter since it seemed like it took care of most of the repetitive work. These days I favor Dist::Zilla -- like the tagline says, it's maximum overkill and through its plugin system can automate just about anything a Perl developer needs to do. I've even written a few plugins.

Oh, and why did I write DCPSO? I was working on a tool to compare WebLogic configuration files, which are just big bags of XML with a lot of settings in no particular order. Plain old diff is no good, and even the XML-savvy variants out there (correctly) insist that element order is significant. So my program slurped in the XML and converted it to a hierarchy of hashes, lists and (you guessed it) unordered sets, reporting how and where one server was truly configured differently from another so I could fix them to be more alike.

A pretty specialized task, but I figured that the set comparison bits could be used elsewhere so I released them. And if not, hey, it got me into CPAN authoring.

1 Comment

Awesome, and welcome to the CPAN contributor community!

Leave a comment

About Mark Gardner

user-pic I help professional Perl developers to engineer modern, disciplined applications in the cloud so they can become experts that write easy-to-maintain code with confidence, increase their relevance in the market and get the best positions, high salaries, and work on interesting projects.