17 if ($] >= 5.009_005) {
18 $impl = \&mro::get_linear_isa;
21 local $SIG{__DIE__} = 'DEFAULT';
22 eval "require MRO::Compat; 1";
25 $impl = \&mro::get_linear_isa;
27 # VVVVV CODE TAKEN FROM MRO::COMPAT VVVVV
28 my $code; # this recurses so it isn't pretty
32 my $classname = shift;
34 my @lin = ($classname);
36 foreach my $parent (@{"$classname\::ISA"}) {
37 my $plin = $code->($parent);
39 next if exists $stored{$_};
46 # ^^^^^ CODE TAKEN FROM MRO::COMPAT ^^^^^
52 *{ __PACKAGE__ . '::get_linear_isa'} = $impl;
56 my $meta = Mouse::Meta::Class->initialize(shift);
60 for (my $i = 0; $i < $max ; $i++) {
61 if ($i + 1 < $max && ref($_[$i + 1])) {
62 push @roles, [ $_[$i++] => $_[$i] ];
64 push @roles, [ $_[$i] => {} ];
68 foreach my $role_spec (@roles) {
69 Mouse::load_class( $role_spec->[0] );
72 ( $_->[0]->can('meta') && $_->[0]->meta->isa('Mouse::Meta::Role') )
73 || croak("You can only consume roles, "
75 . " is not a Moose role")
78 if ( scalar @roles == 1 ) {
79 my ( $role, $params ) = @{ $roles[0] };
80 $role->meta->apply( $meta, ( defined $params ? %$params : () ) );
83 Mouse::Meta::Role->combine_apply($meta, @roles);
94 Mouse::Util - features, with or without their dependencies
96 =head1 IMPLEMENTATIONS FOR
100 =head3 get_linear_isa