March 2011 Archives

Syntax highlighting for

I also love syntax highlighting. To some, it's superfluous. To others, it's downright confusing. But for those of us who use it all day every day, it's an essential tool that helps us read and understand code more quickly and with less effort.

It's always been a minor complaint that does not put syntax h…

Subclassing Tricky Non-Moose Classes: Constructor Problems

We have a non-Moose class but want to make a Moose subclass of it. In the first post, "Subclassing Tricky Non-Moose Classes: Don't Do It", we looked at a way to extend non-Moose classes without actually subclassing them. It is pretty straight-forward, and typically will cause less headaches.

Sometimes that method might not meet your needs, and you might really want to make a Moose subclass of a non-Moose class. This tutorial will get you started with a …

Subclassing Tricky Non-Moose Classes: Don't Do It

First, step back and consider if we really need a subclass.

Don't subclass

There are probably some good arguments against subclassing non-Moose classes with a Moose class that center on principles of good design, and applying the most suitable design patterns. From a practical standpoint, though, there's a very simple reason to avoid it: using Moose to subclass a non-Moose class is fraught with "gotchas." We'll see ="…

About Mark A. Stratman

user-pic Perl developer, forever trapped in the DarkPAN