17 if ($] >= 5.009_005) {
19 $impl = \&mro::get_linear_isa;
22 local $SIG{__DIE__} = 'DEFAULT';
23 eval "require MRO::Compat; 1";
26 $impl = \&mro::get_linear_isa;
28 # VVVVV CODE TAKEN FROM MRO::COMPAT VVVVV
29 my $code; # this recurses so it isn't pretty
33 my $classname = shift;
35 my @lin = ($classname);
37 foreach my $parent (@{"$classname\::ISA"}) {
38 my $plin = $code->($parent);
40 next if exists $stored{$_};
47 # ^^^^^ CODE TAKEN FROM MRO::COMPAT ^^^^^
53 *{ __PACKAGE__ . '::get_linear_isa'} = $impl;
57 my $meta = Mouse::Meta::Class->initialize(shift);
61 # Basis of Data::OptList
63 for (my $i = 0; $i < $max ; $i++) {
64 if ($i + 1 < $max && ref($_[$i + 1])) {
65 push @roles, [ $_[$i++] => $_[$i] ];
67 push @roles, [ $_[$i] => {} ];
71 foreach my $role_spec (@roles) {
72 Mouse::load_class( $role_spec->[0] );
75 ( $_->[0]->can('meta') && $_->[0]->meta->isa('Mouse::Meta::Role') )
76 || croak("You can only consume roles, "
78 . " is not a Moose role")
81 if ( scalar @roles == 1 ) {
82 my ( $role, $params ) = @{ $roles[0] };
83 $role->meta->apply( $meta, ( defined $params ? %$params : () ) );
86 Mouse::Meta::Role->combine_apply($meta, @roles);
97 Mouse::Util - features, with or without their dependencies
99 =head1 IMPLEMENTATIONS FOR
101 =head2 L<MRO::Compat>
103 =head3 get_linear_isa