addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupsimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1outlookpersonJoin Group on CardStartprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

Moonpig: a billing system that doesn't suck by Mark Jason Dominus

Moonpig is an innovative billing and accounting system that Rik Signes and I worked on between 2010 and 2012, totaling about twenty thousand lines of Perl. It was a success, and that is because Rik and I made a number of very smart decisions along the way, many of which weren't obviously smart at the time.

You don't want to hear about the billing and accounting end of Moonpig, so I will discuss that as little as possible, to establish a context for the clever technical designs we made. The rest of the talk is organized as a series of horrible problems and how we avoided, parried, or mitigated them:

•         Times and time zones suck

•         Floating-point arithmetic sucks

•         It sucks to fix your mangled data after an automated process fails

•         Testing a yearlong sequence of events sucks

•         It sucks to have your automated test accidentally send a bunch of bogus invoices to the customers

•         Rounding errors suck

•         Relational databases usually suck

•         Modeling objects in the RDB really really sucks

•         Perl's garbage collection sucks

•         OO inheritance sucks

Moonpig, however, does not suck.

Some of the things I'll talk about will include the design of our web API server and how it played an integral role in the system, our testing strategies, and our idiotically simple (but not simply idiotic) persistent storage solution.

Much of the design is reusable, and is encapsulated in modules that have been released to CPAN or that are available on GitHub, or both.


Mark Dominus has been programming in Perl since 1992.  He is the author of the Tie::File and Memoize modules.  His blog, at , sometimes carries Perl-related material.

Join or login to comment.

  • Mark D.

    In the talk, I claimed that an attempt to use DateTime::Duration to print out the number of seconds elapsed between two dates would emit the string ME CAGO EN LA LECHE. This was a flat-out lie; it does not really do this. However, it was a justified lie, because the *actual* behavior is just as weird and just as useless. The true story is explained here:

    April 25, 2014

    • Bennett T.

      Thank you both.

      April 25, 2014

    • Bennett T.

      Looks like Date::Parse is my friend. Process time_t, do I/O in ISO 8601 / rfc 3339, with help to juggle the input.

      April 25, 2014

  • Mark D.

    Thank you all for coming to listen to my talk. I had a wonderful time.

    A couple of notes about materials on the web:
    1. The slides for the Moonpig talk are at .
    2. As Pat Gunn observed, I wrote up most of the main points of the talk in my blog post at .
    3. The Help! module is described in detail at, but the slides are not yet online; I will publish them at sometime soon after !!Con on May 17–18. My email address is [masked] if anyone would like to send comments or corrections.

    1 · April 25, 2014

  • Bennett T.

    A fun and thoughtful talk. Loved the preamble, illustrating introspection of the inheritance hierarchy before the lovely spicy suggestion that inheritance has been tried, and not found love.

    April 24, 2014

  • Perrin H.

    Fun talk! Sorry I couldn't stick around for the beer. Thanks to the organizers for making it happen.

    1 · April 24, 2014

  • Jordan A.

    April 24, 2014

  • Pat G.

    Watching the talk, and I was getting the strange feeling that I've heard all this before. Turns out he did a blog entry on this a few months ago:

    April 24, 2014

  • Jordan A.

    Please post a comment if you have any issues find the place or getting in, and I'll respond.

    Looking forward to seeing you all.

    April 24, 2014

  • dha

    Very sorry I can't make it, but I have theatre that evening. Depending on how late things run, maybe I can meet up with you all later.

    April 22, 2014

This Meetup is community funded


Member dues are used to:
  • Cover Meetup costs
  • Have a reserve fund
  • Provide supplies or equipment
  • Improve Meetups
  • Excess funds donated annually to non-profit Perl organizations


Members are not required to pay dues, but are encouraged to chip in.

Cancel dues at any time.

Dues are billed each year.

Our Sponsors

  • MongoDB

    Join MongoDBWorld June 28-29. Use code "DavidGolden" for 25% off!

  • RubensteinTech

    RubensteinTech is thrilled to sponsor the NYC Perl Hackathon!

  • is a media site dedicated to Perl and Open Source

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy