| Filename | /home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/Any/Moose.pm |
| Statements | Executed 688 statements in 4.38ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 13 | 1 | 1 | 1.78ms | 6.11ms | Any::Moose::_install_module |
| 13 | 13 | 9 | 546µs | 8.37ms | Any::Moose::import |
| 13 | 1 | 1 | 349µs | 1.20ms | Any::Moose::any_moose |
| 13 | 1 | 1 | 302µs | 396µs | Any::Moose::_backer_of |
| 13 | 1 | 1 | 295µs | 1.50ms | Any::Moose::_canonicalize_options |
| 13 | 1 | 1 | 266µs | 363µs | Any::Moose::_canonicalize_fragment |
| 78 | 7 | 1 | 161µs | 161µs | Any::Moose::CORE:subst (opcode) |
| 10 | 2 | 2 | 37µs | 37µs | Any::Moose::moose_is_preferred |
| 10 | 2 | 1 | 36µs | 36µs | Any::Moose::_is_moose_loaded |
| 1 | 1 | 1 | 32µs | 32µs | Any::Moose::BEGIN@7 |
| 9 | 1 | 1 | 32µs | 32µs | Any::Moose::mouse_is_preferred |
| 22 | 2 | 1 | 32µs | 32µs | Any::Moose::CORE:match (opcode) |
| 1 | 1 | 1 | 20µs | 20µs | Any::Moose::BEGIN@2 |
| 1 | 1 | 1 | 14µs | 20µs | Any::Moose::BEGIN@8 |
| 1 | 1 | 1 | 12µs | 36µs | Any::Moose::BEGIN@191 |
| 1 | 1 | 1 | 11µs | 23µs | Any::Moose::BEGIN@9 |
| 1 | 1 | 1 | 11µs | 40µs | Any::Moose::BEGIN@69 |
| 0 | 0 | 0 | 0s | 0s | Any::Moose::is_moose_loaded |
| 0 | 0 | 0 | 0s | 0s | Any::Moose::unimport |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Any::Moose; | ||||
| 2 | # spent 20µs within Any::Moose::BEGIN@2 which was called:
# once (20µs+0s) by Hailo::BEGIN@11 at line 4 | ||||
| 3 | 1 | 6µs | $Any::Moose::VERSION = '0.13'; | ||
| 4 | 1 | 21µs | 1 | 20µs | } # spent 20µs making 1 call to Any::Moose::BEGIN@2 |
| 5 | # ABSTRACT: use Moose or Mouse modules | ||||
| 6 | |||||
| 7 | 2 | 50µs | 1 | 32µs | # spent 32µs within Any::Moose::BEGIN@7 which was called:
# once (32µs+0s) by Hailo::BEGIN@11 at line 7 # spent 32µs making 1 call to Any::Moose::BEGIN@7 |
| 8 | 2 | 27µs | 2 | 27µs | # spent 20µs (14+7) within Any::Moose::BEGIN@8 which was called:
# once (14µs+7µs) by Hailo::BEGIN@11 at line 8 # spent 20µs making 1 call to Any::Moose::BEGIN@8
# spent 7µs making 1 call to strict::import |
| 9 | 2 | 240µs | 2 | 35µs | # spent 23µs (11+12) within Any::Moose::BEGIN@9 which was called:
# once (11µs+12µs) by Hailo::BEGIN@11 at line 9 # spent 23µs making 1 call to Any::Moose::BEGIN@9
# spent 12µs making 1 call to warnings::import |
| 10 | |||||
| 11 | # decide which backend to use | ||||
| 12 | 1 | 900ns | our $PREFERRED; | ||
| 13 | 1 | 2µs | do { | ||
| 14 | 1 | 1µs | local $@; | ||
| 15 | 1 | 9µs | 1 | 4µs | if ($ENV{ANY_MOOSE}) { # spent 4µs making 1 call to Any::Moose::_is_moose_loaded |
| 16 | $PREFERRED = $ENV{'ANY_MOOSE'}; | ||||
| 17 | warn "ANY_MOOSE is not set to Moose or Mouse" | ||||
| 18 | unless $PREFERRED eq 'Moose' | ||||
| 19 | || $PREFERRED eq 'Mouse'; | ||||
| 20 | |||||
| 21 | # if we die here, then perl gives "unknown error" which doesn't tell | ||||
| 22 | # you what the problem is at all. argh. | ||||
| 23 | if ($PREFERRED eq 'Moose' && !eval { require Moose }) { | ||||
| 24 | warn "\$ANY_MOOSE is set to Moose but we cannot load it"; | ||||
| 25 | } | ||||
| 26 | elsif ($PREFERRED eq 'Mouse' && !eval { require Mouse }) { | ||||
| 27 | warn "\$ANY_MOOSE is set to Mouse but we cannot load it"; | ||||
| 28 | } | ||||
| 29 | } | ||||
| 30 | elsif (_is_moose_loaded()) { | ||||
| 31 | $PREFERRED = 'Moose'; | ||||
| 32 | } | ||||
| 33 | 1 | 108µs | elsif (eval { require Mouse }) { | ||
| 34 | 1 | 2µs | $PREFERRED = 'Mouse'; | ||
| 35 | } | ||||
| 36 | elsif (eval { require Moose }) { | ||||
| 37 | $PREFERRED = 'Moose'; | ||||
| 38 | } | ||||
| 39 | else { | ||||
| 40 | require Carp; | ||||
| 41 | warn "Unable to locate Mouse or Moose in INC"; | ||||
| 42 | } | ||||
| 43 | }; | ||||
| 44 | |||||
| 45 | # spent 8.37ms (546µs+7.82) within Any::Moose::import which was called 13 times, avg 643µs/call:
# once (45µs+1.68ms) by Hailo::Role::Arguments::BEGIN@10 at line 10 of Hailo/Role/Arguments.pm
# once (59µs+848µs) by Hailo::Engine::Default::BEGIN@10 at line 10 of Hailo/Engine/Default.pm
# once (35µs+724µs) by Hailo::BEGIN@12 at line 12 of Hailo.pm
# once (45µs+680µs) by Hailo::BEGIN@11 at line 11 of Hailo.pm
# once (46µs+625µs) by Hailo::Storage::SQLite::BEGIN@10 at line 10 of Hailo/Storage/SQLite.pm
# once (41µs+594µs) by Hailo::Storage::BEGIN@10 at line 10 of Hailo/Storage.pm
# once (43µs+581µs) by Hailo::Tokenizer::Words::BEGIN@11 at line 11 of Hailo/Tokenizer/Words.pm
# once (44µs+401µs) by Hailo::Role::Engine::BEGIN@10 at line 10 of Hailo/Role/Engine.pm
# once (44µs+392µs) by Hailo::Role::Tokenizer::BEGIN@10 at line 10 of Hailo/Role/Tokenizer.pm
# once (40µs+347µs) by Hailo::Role::Storage::BEGIN@10 at line 10 of Hailo/Role/Storage.pm
# once (37µs+339µs) by Hailo::Tokenizer::Words::BEGIN@12 at line 12 of Hailo/Tokenizer/Words.pm
# once (34µs+308µs) by Hailo::Storage::BEGIN@11 at line 11 of Hailo/Storage.pm
# once (34µs+302µs) by Hailo::Storage::SQLite::BEGIN@11 at line 11 of Hailo/Storage/SQLite.pm | ||||
| 46 | 13 | 20µs | my $self = shift; | ||
| 47 | 13 | 22µs | my $pkg = caller; | ||
| 48 | |||||
| 49 | # Any::Moose gives you strict and warnings | ||||
| 50 | 13 | 56µs | 13 | 64µs | strict->import; # spent 64µs making 13 calls to strict::import, avg 5µs/call |
| 51 | 13 | 60µs | 13 | 149µs | warnings->import; # spent 149µs making 13 calls to warnings::import, avg 11µs/call |
| 52 | |||||
| 53 | # first options are for Mo*se | ||||
| 54 | 13 | 24µs | unshift @_, 'Moose' if !@_ || ref($_[0]); | ||
| 55 | |||||
| 56 | 13 | 67µs | while (my $module = shift) { | ||
| 57 | 13 | 23µs | my $options = @_ && ref($_[0]) ? shift : []; | ||
| 58 | |||||
| 59 | 13 | 67µs | 13 | 1.50ms | $options = $self->_canonicalize_options( # spent 1.50ms making 13 calls to Any::Moose::_canonicalize_options, avg 115µs/call |
| 60 | module => $module, | ||||
| 61 | options => $options, | ||||
| 62 | package => $pkg, | ||||
| 63 | ); | ||||
| 64 | |||||
| 65 | 13 | 66µs | 13 | 6.11ms | $self->_install_module($options); # spent 6.11ms making 13 calls to Any::Moose::_install_module, avg 470µs/call |
| 66 | } | ||||
| 67 | |||||
| 68 | # give them any_moose too | ||||
| 69 | 2 | 561µs | 2 | 68µs | # spent 40µs (11+28) within Any::Moose::BEGIN@69 which was called:
# once (11µs+28µs) by Hailo::BEGIN@11 at line 69 # spent 40µs making 1 call to Any::Moose::BEGIN@69
# spent 28µs making 1 call to strict::unimport |
| 70 | 13 | 106µs | *{$pkg.'::any_moose'} = \&any_moose; | ||
| 71 | } | ||||
| 72 | |||||
| 73 | sub unimport { | ||||
| 74 | my $sel = shift; | ||||
| 75 | my $pkg = caller; | ||||
| 76 | my $module; | ||||
| 77 | |||||
| 78 | if(@_){ | ||||
| 79 | $module = any_moose(shift, $pkg); | ||||
| 80 | } | ||||
| 81 | else { | ||||
| 82 | $module = _backer_of($pkg); | ||||
| 83 | } | ||||
| 84 | my $e = do{ | ||||
| 85 | local $@; | ||||
| 86 | eval "package $pkg;\n" | ||||
| 87 | . '$module->unimport();'; | ||||
| 88 | $@; | ||||
| 89 | }; | ||||
| 90 | |||||
| 91 | if ($e) { | ||||
| 92 | require Carp; | ||||
| 93 | Carp::croak("Cannot unimport Any::Moose: $e"); | ||||
| 94 | } | ||||
| 95 | |||||
| 96 | return; | ||||
| 97 | } | ||||
| 98 | |||||
| 99 | # spent 396µs (302+94) within Any::Moose::_backer_of which was called 13 times, avg 30µs/call:
# 13 times (302µs+94µs) by Any::Moose::any_moose at line 169, avg 30µs/call | ||||
| 100 | 13 | 16µs | my $pkg = shift; | ||
| 101 | |||||
| 102 | 13 | 31µs | if(exists $INC{'Mouse.pm'}){ | ||
| 103 | 13 | 51µs | 13 | 43µs | my $meta = Mouse::Util::get_metaclass_by_name($pkg); # spent 43µs making 13 calls to Mouse::Meta::Module::_get_metaclass_by_name, avg 3µs/call |
| 104 | 13 | 19µs | if ($meta) { | ||
| 105 | 4 | 71µs | 4 | 13µs | return 'Mouse::Role' if $meta->isa('Mouse::Meta::Role'); # spent 13µs making 4 calls to UNIVERSAL::isa, avg 3µs/call |
| 106 | 4 | 33µs | 4 | 6µs | return 'Mouse' if $meta->isa('Mouse::Meta::Class'); # spent 6µs making 4 calls to UNIVERSAL::isa, avg 2µs/call |
| 107 | } | ||||
| 108 | } | ||||
| 109 | |||||
| 110 | 9 | 38µs | 9 | 32µs | if (_is_moose_loaded()) { # spent 32µs making 9 calls to Any::Moose::_is_moose_loaded, avg 4µs/call |
| 111 | my $meta = Class::MOP::get_metaclass_by_name($pkg); | ||||
| 112 | if ($meta) { | ||||
| 113 | return 'Moose::Role' if $meta->isa('Moose::Meta::Role'); | ||||
| 114 | return 'Moose' if $meta->isa('Moose::Meta::Class'); | ||||
| 115 | } | ||||
| 116 | } | ||||
| 117 | |||||
| 118 | 9 | 34µs | return undef; | ||
| 119 | } | ||||
| 120 | |||||
| 121 | # spent 1.50ms (295µs+1.20) within Any::Moose::_canonicalize_options which was called 13 times, avg 115µs/call:
# 13 times (295µs+1.20ms) by Any::Moose::import at line 59, avg 115µs/call | ||||
| 122 | 13 | 16µs | my $self = shift; | ||
| 123 | 13 | 52µs | my %args = @_; | ||
| 124 | |||||
| 125 | 13 | 14µs | my %options; | ||
| 126 | 13 | 36µs | if (ref($args{options}) eq 'HASH') { | ||
| 127 | %options = %{ $args{options} }; | ||||
| 128 | } | ||||
| 129 | else { | ||||
| 130 | 13 | 29µs | %options = ( | ||
| 131 | imports => $args{options}, | ||||
| 132 | ); | ||||
| 133 | } | ||||
| 134 | |||||
| 135 | 13 | 22µs | $options{package} = $args{package}; | ||
| 136 | 13 | 65µs | 13 | 1.20ms | $options{module} = any_moose($args{module}, $args{package}); # spent 1.20ms making 13 calls to Any::Moose::any_moose, avg 93µs/call |
| 137 | |||||
| 138 | 13 | 57µs | return \%options; | ||
| 139 | } | ||||
| 140 | |||||
| 141 | # spent 6.11ms (1.78+4.33) within Any::Moose::_install_module which was called 13 times, avg 470µs/call:
# 13 times (1.78ms+4.33ms) by Any::Moose::import at line 65, avg 470µs/call | ||||
| 142 | 13 | 17µs | my $self = shift; | ||
| 143 | 13 | 15µs | my $options = shift; | ||
| 144 | |||||
| 145 | 13 | 20µs | my $module = $options->{module}; | ||
| 146 | 13 | 84µs | 13 | 30µs | (my $file = $module . '.pm') =~ s{::}{/}g; # spent 30µs making 13 calls to Any::Moose::CORE:subst, avg 2µs/call |
| 147 | |||||
| 148 | 13 | 246µs | require $file; | ||
| 149 | |||||
| 150 | 13 | 31µs | my $e = do { | ||
| 151 | 13 | 14µs | local $@; | ||
| 152 | 13 | 473µs | eval "package $options->{package};\n" # spent 20µs executing statements in 2 string evals (merged)
# spent 18µs executing statements in 2 string evals (merged)
# spent 17µs executing statements in 2 string evals (merged)
# spent 16µs executing statements in 2 string evals (merged)
# spent 15µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 9µs executing statements in string eval
# spent 8µs executing statements in string eval | ||
| 153 | . '$module->import(@{ $options->{imports} });'; | ||||
| 154 | 13 | 20µs | $@; | ||
| 155 | }; | ||||
| 156 | 13 | 14µs | if ($e) { | ||
| 157 | require Carp; | ||||
| 158 | Carp::croak("Cannot import Any::Moose: $e"); | ||||
| 159 | } | ||||
| 160 | 13 | 55µs | return; | ||
| 161 | } | ||||
| 162 | |||||
| 163 | # spent 1.20ms (349µs+856µs) within Any::Moose::any_moose which was called 13 times, avg 93µs/call:
# 13 times (349µs+856µs) by Any::Moose::_canonicalize_options at line 136, avg 93µs/call | ||||
| 164 | 13 | 54µs | 13 | 363µs | my $fragment = _canonicalize_fragment(shift); # spent 363µs making 13 calls to Any::Moose::_canonicalize_fragment, avg 28µs/call |
| 165 | 13 | 18µs | my $package = shift || caller; | ||
| 166 | |||||
| 167 | # Mouse gets first dibs because it doesn't introspect existing classes | ||||
| 168 | |||||
| 169 | 13 | 69µs | 13 | 396µs | my $backer = _backer_of($package) || ''; # spent 396µs making 13 calls to Any::Moose::_backer_of, avg 30µs/call |
| 170 | |||||
| 171 | 13 | 71µs | 13 | 22µs | if ($backer =~ /^Mouse/) { # spent 22µs making 13 calls to Any::Moose::CORE:match, avg 2µs/call |
| 172 | 4 | 20µs | 4 | 7µs | $fragment =~ s/^Moose/Mouse/; # spent 7µs making 4 calls to Any::Moose::CORE:subst, avg 2µs/call |
| 173 | 4 | 15µs | return $fragment; | ||
| 174 | } | ||||
| 175 | |||||
| 176 | 9 | 37µs | 9 | 10µs | return $fragment if $backer =~ /^Moose/; # spent 10µs making 9 calls to Any::Moose::CORE:match, avg 1µs/call |
| 177 | |||||
| 178 | 9 | 84µs | 18 | 59µs | $fragment =~ s/^Moose/Mouse/ if mouse_is_preferred(); # spent 32µs making 9 calls to Any::Moose::mouse_is_preferred, avg 4µs/call
# spent 26µs making 9 calls to Any::Moose::CORE:subst, avg 3µs/call |
| 179 | 9 | 37µs | return $fragment; | ||
| 180 | } | ||||
| 181 | |||||
| 182 | 1 | 4µs | for my $name (qw/ | ||
| 183 | load_class | ||||
| 184 | is_class_loaded | ||||
| 185 | class_of | ||||
| 186 | get_metaclass_by_name | ||||
| 187 | get_all_metaclass_instances | ||||
| 188 | get_all_metaclass_names | ||||
| 189 | load_first_existing_class | ||||
| 190 | /) { | ||||
| 191 | 2 | 269µs | 2 | 60µs | # spent 36µs (12+24) within Any::Moose::BEGIN@191 which was called:
# once (12µs+24µs) by Hailo::BEGIN@11 at line 191 # spent 36µs making 1 call to Any::Moose::BEGIN@191
# spent 24µs making 1 call to strict::unimport |
| 192 | *{__PACKAGE__."::$name"} = moose_is_preferred() | ||||
| 193 | ? *{"Class::MOP::$name"} | ||||
| 194 | 7 | 61µs | 7 | 22µs | : *{"Mouse::Util::$name"}; # spent 22µs making 7 calls to Any::Moose::moose_is_preferred, avg 3µs/call |
| 195 | } | ||||
| 196 | |||||
| 197 | 10 | 45µs | # spent 37µs within Any::Moose::moose_is_preferred which was called 10 times, avg 4µs/call:
# 7 times (22µs+0s) by Hailo::BEGIN@11 at line 194, avg 3µs/call
# 3 times (15µs+0s) by Hailo::_new_class at line 199 of Hailo.pm, avg 5µs/call | ||
| 198 | 9 | 38µs | # spent 32µs within Any::Moose::mouse_is_preferred which was called 9 times, avg 4µs/call:
# 9 times (32µs+0s) by Any::Moose::any_moose at line 178, avg 4µs/call | ||
| 199 | |||||
| 200 | 10 | 48µs | sub _is_moose_loaded { exists $INC{'Moose.pm'} } | ||
| 201 | |||||
| 202 | sub is_moose_loaded { | ||||
| 203 | require Carp; | ||||
| 204 | Carp::carp("Any::Moose::is_moose_loaded is deprecated. Please use Any::Moose::moose_is_preferred instead"); | ||||
| 205 | goto \&_is_moose_loaded; | ||||
| 206 | } | ||||
| 207 | |||||
| 208 | # spent 363µs (266+97) within Any::Moose::_canonicalize_fragment which was called 13 times, avg 28µs/call:
# 13 times (266µs+97µs) by Any::Moose::any_moose at line 164, avg 28µs/call | ||||
| 209 | 13 | 16µs | my $fragment = shift; | ||
| 210 | |||||
| 211 | 13 | 15µs | return 'Moose' if !$fragment; | ||
| 212 | |||||
| 213 | # any_moose("X::Types") -> any_moose("MooseX::Types") | ||||
| 214 | 13 | 89µs | 13 | 29µs | $fragment =~ s/^X::/MooseX::/; # spent 29µs making 13 calls to Any::Moose::CORE:subst, avg 2µs/call |
| 215 | |||||
| 216 | # any_moose("::Util") -> any_moose("Moose::Util") | ||||
| 217 | 13 | 68µs | 13 | 23µs | $fragment =~ s/^::/Moose::/; # spent 23µs making 13 calls to Any::Moose::CORE:subst, avg 2µs/call |
| 218 | |||||
| 219 | # any_moose("Mouse::Util") -> any_moose("Moose::Util") | ||||
| 220 | 13 | 61µs | 13 | 17µs | $fragment =~ s/^Mouse(X?)\b/Moose$1/; # spent 17µs making 13 calls to Any::Moose::CORE:subst, avg 1µs/call |
| 221 | |||||
| 222 | # any_moose("Util") -> any_moose("Moose::Util") | ||||
| 223 | 13 | 69µs | 13 | 29µs | $fragment =~ s/^(?!Moose)/Moose::/; # spent 29µs making 13 calls to Any::Moose::CORE:subst, avg 2µs/call |
| 224 | |||||
| 225 | 13 | 59µs | return $fragment; | ||
| 226 | } | ||||
| 227 | |||||
| 228 | 1 | 19µs | 1; | ||
| 229 | |||||
| 230 | |||||
| 231 | =pod | ||||
| 232 | |||||
| 233 | =head1 NAME | ||||
| 234 | |||||
| 235 | Any::Moose - use Moose or Mouse modules | ||||
| 236 | |||||
| 237 | =head1 VERSION | ||||
| 238 | |||||
| 239 | version 0.13 | ||||
| 240 | |||||
| 241 | =head1 SYNOPSIS | ||||
| 242 | |||||
| 243 | |||||
| 244 | =head2 BASIC | ||||
| 245 | |||||
| 246 | |||||
| 247 | package Class; | ||||
| 248 | |||||
| 249 | # uses Moose if it's loaded or demanded, Mouse otherwise | ||||
| 250 | use Any::Moose; | ||||
| 251 | |||||
| 252 | # cleans the namespace up | ||||
| 253 | no Any::Moose; | ||||
| 254 | |||||
| 255 | =head2 OTHER MODULES | ||||
| 256 | |||||
| 257 | |||||
| 258 | package Other::Class; | ||||
| 259 | use Any::Moose; | ||||
| 260 | |||||
| 261 | # uses Moose::Util::TypeConstraints if the class has loaded Moose, | ||||
| 262 | # Mouse::Util::TypeConstraints otherwise. | ||||
| 263 | use Any::Moose '::Util::TypeConstraints'; | ||||
| 264 | |||||
| 265 | =head2 ROLES | ||||
| 266 | |||||
| 267 | |||||
| 268 | package My::Sorter; | ||||
| 269 | use Any::Moose 'Role'; | ||||
| 270 | |||||
| 271 | requires 'cmp'; | ||||
| 272 | |||||
| 273 | =head2 COMPLEX USAGE | ||||
| 274 | |||||
| 275 | |||||
| 276 | package My::Meta::Class; | ||||
| 277 | use Any::Moose; | ||||
| 278 | |||||
| 279 | # uses subtype from Moose::Util::TypeConstraints if the class loaded Moose, | ||||
| 280 | # subtype from Mouse::Util::TypeConstraints otherwise. | ||||
| 281 | # similarly for Mo*se::Util's does_role | ||||
| 282 | use Any::Moose ( | ||||
| 283 | '::Util::TypeConstraints' => ['subtype'], | ||||
| 284 | '::Util' => ['does_role'], | ||||
| 285 | ); | ||||
| 286 | |||||
| 287 | # uses MouseX::Types or MooseX::Types | ||||
| 288 | use Any::Moose 'X::Types'; | ||||
| 289 | |||||
| 290 | # gives you the right class name depending on which Mo*se was loaded | ||||
| 291 | extends any_moose('::Meta::Class'); | ||||
| 292 | |||||
| 293 | =head1 DESCRIPTION | ||||
| 294 | |||||
| 295 | |||||
| 296 | Though we recommend that people generally use L<Moose>, we accept that Moose | ||||
| 297 | cannot yet be used for everything everywhere. People generally like the Moose | ||||
| 298 | sugar, so many people use L<Mouse>, a lightweight replacement for parts of | ||||
| 299 | Moose. | ||||
| 300 | |||||
| 301 | |||||
| 302 | Because Mouse strives for compatibility with Moose, it's easy to substitute one | ||||
| 303 | for the other. This module facilitates that substitution. By default, Mouse | ||||
| 304 | will be provided to libraries, unless Moose is already loaded -or- | ||||
| 305 | explicitly requested by the end-user. The end-user can force the decision | ||||
| 306 | of which backend to use by setting the environment variable C<ANY_MOOSE> to | ||||
| 307 | be C<Moose> or C<Mouse>. | ||||
| 308 | |||||
| 309 | |||||
| 310 | Note that the decision of which backend to use is made only once, so that if | ||||
| 311 | Any-Moose picks Mouse, then a third-party library loads Moose, anything else | ||||
| 312 | that uses Any-Moose will continue to pick Mouse. | ||||
| 313 | |||||
| 314 | |||||
| 315 | So, if you have to use L<Mouse>, please be considerate to the Moose fanboys | ||||
| 316 | (like myself!) and use L<Any-Moose> instead. C<:)> | ||||
| 317 | |||||
| 318 | =head1 SEE ALSO | ||||
| 319 | |||||
| 320 | |||||
| 321 | L<Moose> | ||||
| 322 | |||||
| 323 | |||||
| 324 | L<Mouse> | ||||
| 325 | |||||
| 326 | |||||
| 327 | L<Squirrel> - a deprecated first-stab at Any-Moose-like logic. Its biggest | ||||
| 328 | fault was in making the decision of which backend to use every time it was | ||||
| 329 | used, rather than just once. | ||||
| 330 | |||||
| 331 | =head1 AUTHORS | ||||
| 332 | |||||
| 333 | Shawn M Moore <sartak@bestpractical.com> | ||||
| 334 | Florian Ragwitz <rafl@debian.org> | ||||
| 335 | Stevan Little <stevan@iinteractive.com> | ||||
| 336 | Tokuhiro Matsuno <tokuhirom@gmail.com> | ||||
| 337 | Goro Fuji <gfuji@cpan.org> | ||||
| 338 | |||||
| 339 | =head1 COPYRIGHT AND LICENSE | ||||
| 340 | |||||
| 341 | This software is copyright (c) 2010 by Best Practical Solutions. | ||||
| 342 | |||||
| 343 | This is free software; you can redistribute it and/or modify it under | ||||
| 344 | the same terms as the Perl 5 programming language system itself. | ||||
| 345 | |||||
| 346 | =cut | ||||
| 347 | |||||
| 348 | |||||
| 349 | __END__ | ||||
sub Any::Moose::CORE:match; # opcode | |||||
# spent 161µs within Any::Moose::CORE:subst which was called 78 times, avg 2µs/call:
# 13 times (30µs+0s) by Any::Moose::_install_module at line 146, avg 2µs/call
# 13 times (29µs+0s) by Any::Moose::_canonicalize_fragment at line 214, avg 2µs/call
# 13 times (29µs+0s) by Any::Moose::_canonicalize_fragment at line 223, avg 2µs/call
# 13 times (23µs+0s) by Any::Moose::_canonicalize_fragment at line 217, avg 2µs/call
# 13 times (17µs+0s) by Any::Moose::_canonicalize_fragment at line 220, avg 1µs/call
# 9 times (26µs+0s) by Any::Moose::any_moose at line 178, avg 3µs/call
# 4 times (7µs+0s) by Any::Moose::any_moose at line 172, avg 2µs/call |