Write powerful object-oriented code in a modern and
consistent style—in Perl. HENRY VAN STYN
Perl has been around for more than
20 years. During that time, it has
received its share of both praise and
criticism, and lots of misconceptions
surround it. Much of this stems from
long-outdated notions of what Perl
used to be, but have nothing to do
with what Perl actually is today.
Perl hasn’t been standing still. It’s
been growing continuously and evolving, and that growth has accelerated
dramatically in the past few years.
Moose is one of the technologies at
the heart of this “Perl Renaissance”,
which also includes other exciting
projects that have emerged, such as
Catalyst and DBIx::Class.
Moose is essentially a language extension for Perl 5 that provides a modern,
elegant, fully featured object system. I
say “language extension”, but Moose is
written in pure Perl, and as you’ll see,
its syntax is still normal Perl. You don’t
need to patch Perl itself to use Moose;
under the hood, it’s just Perl 5.
Because Moose is still just Perl 5,
it’s fully compatible with all of those
wonderful modules on CPAN, regard-
124 | SEPTEMBER 2011 WWW.LINUXJOURNAL.COM
less of whether they are written in
Moose (and most aren’t, as CPAN has
been around for so long, and Moose
is relatively new).