Right so the rumor is that
Moose has a lot of dependencies. I mean according
Moose has 24 different dependencies! (Note: that same
site says that almost all of those dependencies have a nearly 100% test
record, but we’re talking Quantity not Quality!). Let’s examine this a bit
Here are the actual direct dependencies from
First Perl … you must be at least version 5.8.1 to play, this means your perl has to have been released sometime after September 2003
Carp ships with 5.00 and above, so you’ve already got it
Scalar::Util 1.19 ships with 5.8.9.
Moose has a dependency on 1.19+ because of known issues in earlier versions. We re-export
blessed as well as use
uniq, these could be
re-implemented but they’re in
List::MoreUtils for a reason. Additionally the
versions here are written in C so there’s very little performance hit.
“Sub::Exporter - a sophisticated exporter for custom-built routines”. Most of Moose’s advanced exporting features are based upon Sub::Exporter.
Sub::Exporter depends on
“Data::OptList - parse and validate simple name/value option pairs”. We use
mkopt internally in Moose::Util. Since Data::OptList is a dependency of a
dependency already (
Sub::Exporter) we can use it “for free”.
“MRO::Compat - mro interface compatibility for Perls < 5.9.5”. Perl 5.10.0
introduced a new
mro pragma that made dealing with the inheritance tree much
easier. This module provides backwards compatibility for that pragma.
Class::C3 which in turn depends on
Algorithm::C3 but neither of
which are used in Moose directly. Note that these two are baked into 5.10 and
thus this entire set of dependencies is a null op under Perls released since
“Devel::GlobalDestruction - Expose PL_dirty, the flag which marks global
destruction.” We expose this as
that is undocumented.
“Scope::Guard - lexically scoped resource management”. This creates a guard object, which is effectively an object that triggers a cleanup function when it is garbage collected.
“Sub::Name - (re)name a sub”. We expose this as
is used extensively internally in both
“Task::Weaken - Ensure that a platform has weaken support”.
sometimes comes in a pure perl variant that lacks the
weaken function that
Moose uses. This ensures that feature is present even on broken installations.
This has been folded into
Class::MOP directly. It was used to maintain Pure
Perl compatibility but that effort was abandoned when maintenance became a
nightmare and we discovered we were never gonna have 100% compatibility
between Pure Perl and XS.
This has become optional.
Class::MOP have over 5519 core tests. We depend heavily on
Test::Exception and several optional modules that if you
have them installed will run extra tests.
“Test::More - yet another framework for writing test scripts.”
Test::More 0.80 ships with Perl 5.8.9.
“Test::Exception - Test exception based code”. Provides
lives_and that are used extensively in the
Moose test suites.
“File::Spec - portably perform operations on file names.” This shipped with 5.004. You have it installed.Written on May 1st , 2009 by Chris Prather