line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
576
|
use 5.008; |
|
1
|
|
|
|
|
3
|
|
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
17
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
65
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Acme::Marvel::CinematicUniverse::Characters; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.003'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Module::Pluggable ( |
11
|
1
|
|
|
|
|
6
|
search_path => [ 'Acme::Marvel::CinematicUniverse::Character::Instance' ], |
12
|
|
|
|
|
|
|
sub_name => 'instance_modules', |
13
|
|
|
|
|
|
|
require => 1, |
14
|
1
|
|
|
1
|
|
402
|
); |
|
1
|
|
|
|
|
8691
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my @characters; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub load_character { |
19
|
6
|
|
|
6
|
1
|
12
|
my ( $class ) = ( shift ); |
20
|
6
|
|
|
|
|
32
|
push @characters, @_; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub characters { |
24
|
1
|
|
|
1
|
1
|
415
|
my ( $class ) = ( shift ); |
25
|
1
|
|
|
|
|
5
|
return @characters; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub find { |
29
|
2
|
|
|
2
|
1
|
5
|
my ( $class, $search ) = ( shift, @_ ); |
30
|
|
|
|
|
|
|
my $re = |
31
|
|
|
|
|
|
|
ref( $search ) |
32
|
|
|
|
|
|
|
? $search |
33
|
2
|
100
|
|
|
|
7
|
: do { my $q = quotemeta( $search ); qr/$q/i }; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
34
|
2
|
|
|
|
|
10
|
my @found = grep /$re/, @characters; |
35
|
2
|
100
|
|
|
|
9
|
wantarray ? @found : $found[0]; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
unless ( $ENV{MITE_COMPILE} ) { |
39
|
|
|
|
|
|
|
$_->init( __PACKAGE__ ) for __PACKAGE__->instance_modules; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |