From 058e72e8f85aef0a3ad94cd1f27b34f0c1503cb4 Mon Sep 17 00:00:00 2001 From: Shawn M Moore Date: Tue, 3 Feb 2009 15:46:19 -0500 Subject: [PATCH] Use Moose stuff if it's loaded --- lib/Any/Moose.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Any/Moose.pm b/lib/Any/Moose.pm index fce14e7..26c0d1c 100644 --- a/lib/Any/Moose.pm +++ b/lib/Any/Moose.pm @@ -72,8 +72,11 @@ sub any_moose { return $fragment if $INC{'Class/MOP.pm'} && Class::MOP::does_metaclass_exist($package); - # If we're loading up the backing class, then give them Mouse - return 'Mouse' if $fragment eq 'Moose'; + # If we're loading up the backing class... + if ($fragment eq 'Moose') { + return 'Moose' if $INC{'Class/MOP.pm'}; + return 'Mouse'; + } require Carp; Carp::croak "Neither Moose nor Mouse backs the '$package' package.";