Permalink
Browse files

Simplify aliasing

  • Loading branch information...
sartak committed Apr 2, 2010
1 parent c193d86 commit 60e4860acf8a87e01b7b4eac50f9d6da2ef77fda
Showing with 4 additions and 6 deletions.
  1. +4 −6 lib/Any/Moose.pm
View
@@ -167,13 +167,11 @@ sub any_moose {
return $fragment;
}
-for (
- [load_class => 'Class::MOP::load_class', 'Mouse::load_class'],
- [is_class_loaded => 'Class::MOP::is_class_loaded', 'Mouse::is_class_loaded'],
-) {
- my ($function_name, $moose_symbol, $mouse_symbol) = @$_;
+for my $name (qw/load_class is_class_loaded/) {
no strict 'refs';
- *{__PACKAGE__.'::'.$function_name} = moose_is_preferred() ? $moose_symbol : $mouse_symbol;
+ *{__PACKAGE__."::$name"} = moose_is_preferred()
+ ? *{"Class::MOP::$name"}
+ : *{"Mouse::Util::$name"};
}
sub moose_is_preferred { $PREFERRED eq 'Moose' }

0 comments on commit 60e4860

Please sign in to comment.