Moose: a guide to the new revolution

First given: July 20, 2014

an introduction to Moose, Perl's postmodern object system

Abstract

Perl’s system for object-orientation is powerful, turning over control of nearly everything to the programmer. It abides by Perl’s motto, “There’s more than one way to do it!” The Moose philosophy agrees, but pencils in its own amendment, “There is more than one way to do it, but sometimes consistency is not a bad thing either.” By establishing a common system for building classes, Moose enables new levels of code reuse, allowing you to improve your code with features that would otherwise be too complex or expensive to implement on your own.

Although its compact, declarative look can seem perplexing at first glance, Moose is just Perl, and can be easily explained, learned, understood, and put to use. This tutorial will cover all of Moose’s basic features, including attributes, subclassing, method modifiers, roles, and types.

Notes

This was my first really long (three hour) talk, and I tried to be very prepared. I try to always do some rehearsal, but this one got several full-length run-throughs. That’s a lot of time when the talk is three hours long! The last two were done in my room at the Jupiter in Portland, presenting to an empty room. If my notes are correct, I gave this talk on my birthday… but I’m not sure I believe that.

An early version of the Mondrian-inspired title slide included a purple square, but both Stevan Little and I realized almost immediately that Mondrian would never.

🐪 perl
🧑🏽‍💻 programming