16 if ($] >= 5.009_005) {
17 $impl = \&mro::get_linear_isa;
20 local $SIG{__DIE__} = 'DEFAULT';
21 eval "require MRO::Compat; 1";
24 $impl = \&mro::get_linear_isa;
26 # VVVVV CODE TAKEN FROM MRO::COMPAT VVVVV
27 my $code; # this recurses so it isn't pretty
31 my $classname = shift;
33 my @lin = ($classname);
35 foreach my $parent (@{"$classname\::ISA"}) {
36 my $plin = $code->($parent);
38 next if exists $stored{$_};
45 # ^^^^^ CODE TAKEN FROM MRO::COMPAT ^^^^^
51 *{ __PACKAGE__ . '::get_linear_isa'} = $impl;
55 my $meta = Mouse::Meta::Class->initialize(shift);
59 # Basis of Data::OptList
61 for (my $i = 0; $i < $max ; $i++) {
62 if ($i + 1 < $max && ref($_[$i + 1])) {
63 push @roles, [ $_[$i++] => $_[$i] ];
65 push @roles, [ $_[$i] => {} ];
69 foreach my $role_spec (@roles) {
70 Mouse::load_class( $role_spec->[0] );
73 ( $_->[0]->can('meta') && $_->[0]->meta->isa('Mouse::Meta::Role') )
74 || croak("You can only consume roles, "
76 . " is not a Moose role")
79 if ( scalar @roles == 1 ) {
80 my ( $role, $params ) = @{ $roles[0] };
81 $role->meta->apply( $meta, ( defined $params ? %$params : () ) );
84 Mouse::Meta::Role->combine_apply($meta, @roles);
95 Mouse::Util - features, with or without their dependencies
97 =head1 IMPLEMENTATIONS FOR
101 =head3 get_linear_isa